8

Leaving aside possible differences stemming from code structure changes to conform with "use strict";, does running code in strict mode offer any speed benefits?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Etheryte
  • 24,589
  • 11
  • 71
  • 116
  • 1
    Great question! I am wondering what the answer will be. – David Snabel Feb 05 '15 at 13:35
  • Do you mean client side or Node.js? – David Snabel Feb 05 '15 at 13:37
  • I'm mainly interested in the client-side, that's I tagged the question with Javascript, but not with Node.js, however, if you can chip in on server-side Javascript, that would be great too. – Etheryte Feb 05 '15 at 13:38
  • The answer to JavaScript performance questions is almost always ***it depends*** (on what engine, on what the code is doing, on the time of day, on whether it's currently daylight savings time, on which constellation is rising in Venus...okay, some of those might have been a bit facetious). – T.J. Crowder Feb 05 '15 at 13:38
  • 5
    Read this [Is strict mode more performant?](http://stackoverflow.com/questions/3145966/is-strict-mode-more-performant) – Anatoli Feb 05 '15 at 13:38
  • It has something todo with runtime checks I believe. – David Snabel Feb 05 '15 at 13:39
  • 2
    "Strict mode fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode." ([source](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)) – grc Feb 05 '15 at 13:41

0 Answers0