前言

项目 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)相关推荐

  1. 在node.js中如何使用ES6模块化

    配置: 1.确保安装了v14.15.1或更高版本的node.js 2.在package.json的根节点中添加"type": "module"节点 查看node ...

  2. boa支持https_Boa: 在 Node.js 中使用 Python

    Hello,大家好,有一段时间不见了. 这次主要给大家带来一个好东西,它的主要用途就是能让大家在 Node.js 中使用 Python 的接口和函数.可能你看到这里会好奇,会疑惑,会不解,我 Node ...

  3. import export php,import与export在node.js中的使用方法

    import与export是es6中模块化的导入与导出,node.js现阶段不支持,需要通过babel进行编译,使其变成node.js的模块化代码.(关于node.js模块,可参考其他node.js模 ...

  4. ENSP如何开启服务器的http_如何使用HTTP模块在Node.js中创建Web服务器(上)

    当你在浏览器中查看网页时,其实是在向互联网上的另一台计算机发出请求,然后它会将网页提供给你作为响应.你通过互联网与之交谈的那台计算机就是Web服务器,Web服务器从客户端(例如你的浏览器)接收HTTP ...

  5. 如何正确使用Node.js中的事件

    by Usama Ashraf 通过Usama Ashraf 如何正确使用Node.js中的事件 (How to use events in Node.js the right way) Before ...

  6. 如何在Node.js中处理POST数据?

    如何提取Node.js中 HTTP POST方法发送的表单数据( form[method="post"] )和文件上传? 我已经阅读了文档,谷歌搜索并没有发现任何东西. funct ...

  7. 在 Node.js 中操作 Redis

    在 Node.js 中操作 Redis Node.js 中可以操作 Redis 的软件包推荐列表:https://redis.io/clients#nodejs. 推荐下面两个: node-redis ...

  8. [转]JavaScript/Node.JS 中的 Promises

    JavaScript Promises 初体验 Promise 是什么? Promise 对象用来进行延迟(deferred) 和 异步(asynchronous) 计算. 一个 Promise 处于 ...

  9. 模块加载及第三方包:Node.js模块化开发、系统模块、第三方模块、package.json文件、Node.js中模块的加载机制、开发环境与生产环境、cookie与session

    1.Node.js模块化开发 1.1 JavaScript开发弊端 JavaScript 在使用时存在两大问题,文件依赖和命名冲突. 1.2 软件中的模块化开发 一个功能就是一个模块,多个模块可以组成 ...

最新文章

  1. 2021 整理的最全学习资源,送给每一个努力着的人
  2. 决策树 prepruning_智能建筑运维前探 AI天天见之五:决策树算法应用探索
  3. wifi密码本 字典(免费)
  4. Kindle Touch 5.3.7上手使用指南
  5. 使用android busybox拷贝文件到qnx系统
  6. 安卓逆向 -- 防抓包破解(JustTrustMe)
  7. 基于车牌形状和颜色的车牌定位
  8. 商用密码产品认证-金融数据密码机
  9. 为什么说HTTP协议是无状态的
  10. 从字符串中查找并提取数字
  11. 淘宝联盟官方APi在小程序云函数中的使用教程(附案例)
  12. 微信小程序简单介绍及例子,小白可看
  13. unity3d 压缩文件夹和压缩文件
  14. Postman如何使用(三):使用数据文件【入门到精通】
  15. HTTP常用的响应码说明(网页/服务器显示200、302、404、500是什么意思,表示什么)
  16. NLP入门概览(3)—— 神经网络语言模型、词向量
  17. 扒一扒云服务器和VPS主机有啥不一样
  18. 两种实现Z-Score的方法
  19. #Reading Paper# 【序列推荐】ICKM 2022 RETR:Recommender Transformers with Behavior Pathways
  20. 大规模图像检索深度特征:Large-Scale Image Retrieval with Attentive Deep Local Features

热门文章

  1. enum python_enum:python实现枚举也很优雅
  2. python数据结构的列表_Python内置数据结构——列表list
  3. 深度学习:人脸识别学习笔记
  4. Pyramid Scene Parsing Network
  5. 【图像分割模型】多分辨率特征融合—RefineNet
  6. 【AI白身境】深度学习中的数据可视化
  7. 中国太阳能热水器市场营销模式探析与品牌格局调研报告2022版
  8. 全球及中国小水电行业投资规模及运行动态分析报告2021年版
  9. 微机原理及接口技术-6
  10. 现代农业谋定县域经济-农业大健康·万祥军:载体幸福美丽