Performance of Google chrome vs nodejs (v8)?

后端 未结 3 710
暖寄归人
暖寄归人 2021-02-01 08:42

\"enter

Example

     console.time("Test");
     for(var i=0; i         


        
3条回答
  •  粉色の甜心
    2021-02-01 09:30

    It's far from being as dramatic now, but I did get 2x boost from 5.417ms down to 2ms on your test. I had near absolute same values on Node and Chrome when I used a larger loop and a function wrap.

    (function(){
    console.time("Test");
    for(var i=0; i <10000000000; i +=1 ){
         // loop around
    }
    console.timeEnd("Test");
    }).call(this);
    

提交回复
热议问题