首页 > 编程语言 > 详细

Promise的实现为什么是JS而不是用C++引擎

时间:2020-05-15 22:06:10      阅读:75      评论:0      收藏:0      [点我收藏+]

"

Bluebird author here.

V8 promises implementation is written in JavaScript not C. All JavaScript (including V8‘s own) is compiled to native code.

Additionally user written JavaScript is optimized, if possible (and worth it), before compiled to native code.

Promises implementation is something that would not benefit much or at all from being written in C, in fact it would only make it slower because all you are doing is manipulating JavaScript objects and communication.

"

因为promise的操作中都是在操纵js对象,控制他们通信

Promise的实现为什么是JS而不是用C++引擎

原文:https://www.cnblogs.com/eret9616/p/12897381.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!