V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
magicdawn
V2EX  ›  Node.js

V8 Release 5.4

  •  
  •   magicdawn · 2016-09-10 13:02:06 +08:00 · 3863 次点击
    这是一个创建于 3014 天前的主题,其中的信息可能已经有所发展或是发生改变。

    V8 Release 5.4

    Every six weeks, we create a new branch of V8 as part of our release process. Each version is branched from V8 ’ s git master immediately before a Chrome Beta milestone. Today we ’ re pleased to announce our newest branch, V8 version 5.4, which will be in beta until it is released in coordination with Chrome 54 Stable in several weeks. V8 5.4 is filled will all sorts of developer-facing goodies, so we ’ d like to give you a preview of some of the highlights in anticipation of the release.

    每六周, 我们都会为 V8 创建一个新分支, 作为 release process 的一部分. 每个版本都是在 Chrome 的一个 Beta milestone 之前从 master 分支立即切出. 今天我们很高兴宣布我们最新的分支, V8 5.4 , 在数周之后的 Chrome 54 稳定版发布之前, V8 5.4 将会一直是 beta 版. V8 5.4 有很多开发者喜欢的东西, 这里将展示这次发布的一些闪光点.

    Performance Improvements

    V8 5.4 delivers a number of key improvements in memory footprint and startup speed. These primarily help accelerate initial script execution and reduce page load in Chrome.

    V8 5.4 提供了许多的内存占用和启动速度关键的改进。这些主要是帮助加快启动脚本的执行,并减少 Chrome 页面加载。

    Memory

    When measuring V8 ’ s memory consumption, two metrics are very important to monitor and understand: Peak memory consumption and average memory consumption. Typically, reducing peak consumption is just as important as reducing average consumption since an executing script that exhausts available memory even for a brief moment can cause an Out of Memory crash, even if its average memory consumption is not very high. For optimization purposes, it ’ s useful to divide V8's memory into two categories: containing actual JavaScript objects and containing the rest, such as internal data structures allocated by the compiler, parser and garbage collector.

    当测量 V8 的内存消耗,有两个指标对监测和了解非常重要:峰值内存消耗平均内存消耗。通常情况下,减少峰值消耗同减少平均内存消耗一样重要, 因为一个将要耗尽可用的内存的执行脚本,即使是一瞬间, 会导致 Out of Memory crash, 即使它的平均内存占用不是很高。为了优化,将 V8 的内存分为两类很有用: On-heap memory 包含了实际的 JavaScript 对象以及 off-heap memory 包含了其余如由编译器,分析器和垃圾收集程序分配的内部数据结构。

    In 5.4 we tuned V8 ’ s garbage collector for low-memory devices with 512 MB RAM or less. Depending on the website displayed this reduces peak memory consumption of on-heap memory up to 40%.

    在 5.4 版本中, 我们为 512MB 或 更少的低内存设备调整了垃圾回收器. 根据网站上显示这样减少 on-heap memory 峰值内存消耗高达40 %

    Memory management inside V8 ’ s JavaScript parser was simplified to avoid unnecessary allocations, reducing off-heap peak memory usage by up to 20%. This memory savings is especially helpful in reducing memory usage of large script files, including asm.js applications.

    V8 的 JavaScript 语法分析器内的内存管理得到了简化,以避免不必要的分配,最多可减少 20 % off-heap peak memory 的峰值内存。这对大脚本文件的内存消耗很有帮助,包括 asm.js 应用程序。

    Startup & speed

    Our work to streamline V8's parser not only helped reduce memory consumption, it also improved the parser's runtime performance. This streamlining, combined with other optimizations of JavaScript builtins and how accesses of properties on JavaScript objects use global inline caches , resulted in notable startup performance gains.

    我们的工作简化 V8 的解析器不仅有助于减少内存消耗,也提高了解析器的运行时性能。这种精简,结合 JavaScript 的内部优化以及使用全局 inline caches 访问 JavaScript 对象的属性, 带来了显著的启动性能提升。

    Our internal startup test suite that measures real-world JavaScript performance improved by a median of 5%. The Speedometer benchmark also benefits from these optimizations, improving by ~ 10 to 13% compared to 5.2.

    我们用于测量真实世界 JavaScript 性能的 内部启动测试套件 有了 5 %的中值的提高。Speedometer 性能测试也从这些优化中受益,由 5.2 提高了约 10 至 13 %

    V8 API

    Please check out our summary of API changes . This document is regularly updated a few weeks after each major release.

    Developers with an active V8 checkout can use 'git checkout -b 5.4 -t branch-heads/5.4' to experiment with the new features in V8 5.4. Alternatively you can subscribe to Chrome's Beta channel and try the new features out yourself soon.

    Posted by the V8 team

    4 条回复    2016-09-10 15:22:17 +08:00
    willm
        1
    willm  
       2016-09-10 14:52:24 +08:00
    所以 chrome 的内存占用有可能减少 5%左右的样子?
    alcarl
        2
    alcarl  
       2016-09-10 15:12:55 +08:00
    我想知道。。。。。为嘛这个页面背景是黑的??
    magicdawn
        3
    magicdawn  
    OP
       2016-09-10 15:21:31 +08:00
    markdown 的 quote 效果, 显示不出来...
    magicdawn
        4
    magicdawn  
    OP
       2016-09-10 15:22:17 +08:00
    @alcarl Node.js 节点下的都是这样的 https://nodejs.org/en/docs/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4956 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:54 · PVG 16:54 · LAX 00:54 · JFK 03:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.