Comparison of performance impact for anonymous functions with JavaScript variable versus local named functions.

# On Count Var|Half|Ggl full, sec run, sec eval, sec file size, bytes render, sec Browser Urls
0 1000 Each Fun Local 0.006 0.004 0.785 102884 0.002 Chrome/3.0 script
1 500 Half Fun Local 0.006 0.003 0.763 102884 0.003 Chrome/3.0 script
2 1000 Each Var Local 0.947 0.911 0.99 106884 0.036 Chrome/3.0 script
3 500 Half Var Local 0.941 0.931 0.996 106884 0.01 Chrome/3.0 script
4 1000 Each Fun Global 0.206 0.042 0.099 102888 0.164 Chrome/3.0 script
5 500 Half Fun Global 0.208 0.028 0.11 102888 0.18 Chrome/3.0 script
6 1000 Each Var Global 0.201 0.047 0.284 106888 0.154 Chrome/3.0 script
7 500 Half Var Global 0.12 0.025 0.255 106888 0.095 Chrome/3.0 script
total functions > 13000
total time, sec 9.494
prerendered static files: 500 | 1000 | 3000 | 10000

Goal is to compare timing on similar set of functions(named and anonymous) for:

Additional requirements:

Sources:

index.jsp - this file | AnonymousJsVsNamed.js.jsp - JS rendering JSP
© Sasha Firsov, 2010