In 5.5, V8 ships JavaScript ES2017 async functions, which makes it easier to write code that uses and creates Promises. Using async functions, waiting for a Promise to resolve is as simple as typing await before it and proceeding as if the value were synchronously available - no callbacks required. See this article for an introduction.
Here’s an example function which fetches a URL and returns the text of the response, written in a typical asynchronous, Promise-based style.
V8 5.5 delivers a number of key improvements in memory footprint.
Memory
Memory consumption is an important dimension in the JavaScript virtual machine performance trade-off space. Over the last few releases, the V8 team analyzed and significantly reduced the memory footprint of several websites that were identified as representative of modern web development patterns. V8 5.5 reduces Chrome’s overall memory consumption by up to 35% on low-memory devices (compared to V8 5.3 in Chrome 53) due to reductions in the V8 heap size and zone memory usage. Other device segments also benefit from the zone memory reductions. Please have a look at the dedicated blog post to get a detailed view.
就等import了
来自 KoaHubjs
koa2.0已经在用了
来自 KoaHub.js
昨天安装还是7.5,现在就7.6了
赞,7.6终于支持async/await
这是最吼滴
牛逼 homebrew更新了一下 已经7.6了
真是好消息啊 也希望原生的Promise能更优化一点,提供更多的方法。
@einsqing 估计楼主的意思是2.x正式版的意思 koa团队一直在等待node对async的默认支持
@zengming00 我也是昨天安装还是7。5
import 有提案了?
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V7.md#7.6.0
Async functions
In 5.5, V8 ships JavaScript ES2017 async functions, which makes it easier to write code that uses and creates Promises. Using async functions, waiting for a Promise to resolve is as simple as typing await before it and proceeding as if the value were synchronously available - no callbacks required. See this article for an introduction.
Here’s an example function which fetches a URL and returns the text of the response, written in a typical asynchronous, Promise-based style.
Here’s the same code rewritten to remove callbacks, using async functions.
Performance improvements
V8 5.5 delivers a number of key improvements in memory footprint.
Memory
谁有时间翻译一下这段?
真是一个好消息!
koa 2.0 也没个发布计划时间表。
然而v8已经撸到5.7了, 总算async/await 能有个4倍左右的提升, 之前的本地测试 Node 7.4的koa2 async/await 比 express还稍差一点(10~25中间件),希望等用上5.7后能赶上koa1吧
https://v8project.blogspot.sg/2017/02/v8-release-57.html
v8 5.5 实现了内存占用的一些关键优化 内存占用高是JS虚拟机实现高性能的一个重要取舍。在之前几个版本中,V8团队分析并显著降低了一些应用现代web开发模式的代表性网站的内存占用。v8 5.5版 通过降低heap size 和zone memory usage,降低了chrome在低内存设备至多35%的总体内存消耗(和chrome 53的v8 5.3相比)。其他设备也能从更低的zone memory usage获益
这俩名词想不出合适的翻译。。慢慢啃原文吧 heap size & zone memory usage 是啥 v8 heap size
@w10036w 我测试的koa稍高一点点,偶尔比express低的
@i5ting 下午测试了下7.6.0 t8 c50 mw10/15/20/25,koa2 async 达到koa2的2/3,已经超越express和koa1 主要考虑到实际使用中边缘情况较少,所以没算<10和>30的情况 koa2 async/await
koa2
koa1
express
@w10036w请教大神,怎么测试的?