Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Javascript var vs let (de)optimization/slowdown issue in FF/SpiderMonkey

  • 3 replies
  • 2 have this problem
  • 1 view
  • Last reply by olvap80

more options

Firefox ver 53 (32 bit) on Windows - using modern JavaScript slows down execution speed drastically in some cases. Solution for FF is needed, assuming I have access to FF command line and able to tune registry, edit local FF settings, etc.

Exact code with slowdown

https://jsfiddle.net/nhppmzov/ and http://stackoverflow.com/questions/43153889/javascript-var-vs-let-deoptimization-slowdown-issue-in-v8-and-spidermonkey

without_let: 98.08ms let_below: 94.21ms let_above_and_in_loop: 877.85ms <---------- Slowdown let_in_loop: 96.63ms

=============

without_let: 289.560ms let_below: 296.265ms let_above_and_in_loop: 880.340ms <---------- Slowdown let_in_loop: 314.395ms

Firefox ver 53 (32 bit) on Windows - using modern JavaScript slows down execution speed drastically in some cases. Solution for FF is needed, assuming I have access to FF command line and able to tune registry, edit local FF settings, etc. Exact code with slowdown https://jsfiddle.net/nhppmzov/ and http://stackoverflow.com/questions/43153889/javascript-var-vs-let-deoptimization-slowdown-issue-in-v8-and-spidermonkey without_let: 98.08ms let_below: 94.21ms let_above_and_in_loop: 877.85ms <---------- Slowdown let_in_loop: 96.63ms ========================= without_let: 289.560ms let_below: 296.265ms let_above_and_in_loop: 880.340ms <---------- Slowdown let_in_loop: 314.395ms

All Replies (3)

more options

hi olvap80, thanks for your investigation! https://bugzilla.mozilla.org would be the right place to file your findings though if you want to reach firefox developers, as the site here is mostly user to user support.

Modified by philipp

more options

It's probably on someone's to do list to optimize, but... I couldn't tell you. This is one of the most challenging topics I've ever tried to search because the word "let" is everywhere.

more options

philipp said

hi olvap80, thanks for your investigation! https://bugzilla.mozilla.org would be the right place to file your findings though if you want to reach firefox developers, as the site here is mostly user to user support.

Thanks, here is corresponding bugzilla item just opened https://bugzilla.mozilla.org/show_bug.cgi?id=1362930