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.038 0.032 0.028 324889 0.006 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
1 1500 Half Fun Local 0.031 0.022 0.02 324892 0.009 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
2 3000 Each Var Local 0.045 0.028 0.031 336889 0.017 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.02 0.023 336889 0.003 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
4 3000 Each Fun Global 0.019 0.016 0.027 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.015 0.009 0.019 324893 0.006 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
6 3000 Each Var Global 0.022 0.018 0.03 336893 0.004 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
7 1500 Half Var Global 0.015 0.009 0.023 336893 0.006 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) script
total functions > 39000
total time, sec 0.926
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