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 3000 Each Fun Local 1.653 0.03 0.033 324889 1.623 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
1 1500 Half Fun Local 0.023 0.017 0.021 324892 0.006 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
2 3000 Each Var Local 0.035 0.028 0.032 336889 0.007 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
3 1500 Half Var Local 0.023 0.019 0.047 336889 0.004 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
4 3000 Each Fun Global 0.037 0.022 0.041 324893 0.015 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
5 1500 Half Fun Global 0.026 0.017 0.052 324893 0.009 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
6 3000 Each Var Global 0.052 0.035 0.033 336893 0.017 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
7 1500 Half Var Global 0.022 0.013 0.023 336893 0.009 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
total functions > 39000
total time, sec 4.231
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