Is strict mode more performant?

前端 未结 4 493
你的背包
你的背包 2020-11-30 02:50

Does executing javascript within a browser in \'strict mode\' make it more performant, in general? Do any of the major browsers do additional optimisation or use any other t

4条回答
  •  囚心锁ツ
    2020-11-30 03:12

    According to this test "strict mode" can be about 25% faster.

    Q
    Q

    This can be tested here: http://jsperf.com/strict-mode


    Interestingly, manipulation of the arguments array can be around 6 times faster in "strict mode"!

    
    

    Here's the jsPerf test: http://jsperf.com/strict-mode-arguments

提交回复
热议问题