日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

一些当前 Node.js 中最流行 ES6 特性的 benchmark (V8 / Chakra)

發布時間:2025/3/20 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 一些当前 Node.js 中最流行 ES6 特性的 benchmark (V8 / Chakra) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

項目 github 地址:https://github.com/DavidCai1993/ES6-benchmark

如果有想要增加的特性 benchmark ,歡迎更新benchmarks/ ,然后 PR 。

環境

  • CPU: Intel Core(TM) i5-2410M 2.30GHz

  • Memory: 8GB 1600 MHz DDR3

  • Node.js: 5.9.0 / Node-chakracore 6.0.0-pre5

大致結論

許多情況下: V8 ES5 >> Chakra ES6 > Chakra ES5 > V8 ES6

Chakra 下的 ES6 特性表現相對更好。

Benchmark

concat-strings.js

V8: template string vs use +14,643,602 op/s ? ${a}${b}96,959,110 op/s ? a + bChakra: template string vs use +35,756,501 op/s ? ${a}${b}19,995,366 op/s ? a + b

for-of-for-loop.js

V8: for...of vs for loop851,761 op/s ? for...of12,507,823 op/s ? for loop, i < arr.lengthChakra: for...of vs for loop1,133,193 op/s ? for...of16,715,320 op/s ? for loop, i < arr.length

merge-objects.js

V8: merge objects669,921 op/s ? Object.assign23,625,182 op/s ? for...in loop and assignChakra: merge objects3,102,889 op/s ? Object.assign3,744,837 op/s ? for...in loop and assign

declear-class.js

V8: declear a class118,864 op/s ? Class153,662 op/s ? use function and prototypeChakra: declear a class560,705 op/s ? Class701,991 op/s ? use function and prototype

repeat-string.js

V8: string.repeat() vs use +8,828,842 op/s ? string.repeat()107,824,137 op/s ? use +Chakra: string.repeat() vs use +13,022,259 op/s ? string.repeat()3,328,631 op/s ? use +

array-like-to-array.js

V8: array like object to array1,302,649 op/s ? Array.from540,458 op/s ? Array.prototype.slice.callChakra: array like object to array1,864,649 op/s ? Array.from2,537,458 op/s ? Array.prototype.slice.call

promise-bluebird.js

promise vs bluebird V8:322,534 op/s ? promise1,763,186 op/s ? bluebirdChakra:69,534 op/s ? promise178,186 op/s ? bluebird

var-let-const.js

V8: var let const134,028,614 op/s ? let129,193,000 op/s ? const431,460,321 op/s ? varChakra: var let const156,028,614 op/s ? let170,193,000 op/s ? const150,460,321 op/s ? var

string-start-with.js

V8: string starts with9,774,987 op/s ? string.startsWith(value)74,127,611 op/s ? string[0] === valueChakra: string starts with26,774,987 op/s ? string.startsWith(value)47,127,611 op/s ? string[0] === value

define-a-funciton-with-this.js

V8: define a function with inherited this59,661,143 op/s ? () =>64,874,220 op/s ? function statementChakra: define a function with inherited this69,661,143 op/s ? () =>69,874,220 op/s ? function statement

parse-int.js

V8: global.parseInt() vs Number.parseInt()53,940,634 op/s ? Number.parseInt()81,509,873 op/s ? global.parseInt()Chakra: global.parseInt() vs Number.parseInt()16,940,634 op/s ? Number.parseInt()19,509,873 op/s ? global.parseInt()

總結

以上是生活随笔為你收集整理的一些当前 Node.js 中最流行 ES6 特性的 benchmark (V8 / Chakra)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。