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 0.03 0.025 0.03 324889 0.005 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
1 1500 Half Fun Local 0.042 0.027 0.021 324892 0.015 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
2 3000 Each Var Local 0.031 0.027 0.032 336889 0.004 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
3 1500 Half Var Local 0.037 0.022 0.024 336889 0.015 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
4 3000 Each Fun Global 0.02 0.017 0.029 324893 0.003 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
5 1500 Half Fun Global 0.016 0.009 0.029 324893 0.007 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
6 3000 Each Var Global 0.021 0.018 0.031 336893 0.003 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
7 1500 Half Var Global 0.02 0.011 0.037 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 1.041
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