Chrome 55 的重大改革:記憶體、Flash停用、HTML5的時代

2016-12-09 Chrome

這幾天一直在外奔波,在群組內一直有人提到 Chrome 55 ,但一直無法去 follow,今天終於有時間可以去了解 Google 在搞什麼鬼

 

一直以來 Google Chrome 擁有了很大的市占率,但是這幾年開始被其他的瀏覽器瓜分了一些地盤,最大的問題莫過於 Chrome 被冠上 吃記憶體怪獸 的這個名號,而終於在 Chrome 55 獲得了不錯的解決

 

記憶體改善

一位 Prerender 整理了 Chrome 54 and 55 的記憶體使用差異「Chrome 55 uses ~30% less memory than Chrome 54

這位作者使用 Docker container 進行測試,並且給予 300MB 測試 Weather.com 這個網站,在 Chrome 54 大於 340MB 造成 container 記憶體崩潰,而在 Chrome 55 大幅改善僅使用 250MB 左右,前後差異了 26 % 以及其他的測試。

從 Google 的說法是 Chrome 55 的 V8 JavaScript 進行了記憶體的優化「Fall cleaning: Optimizing V8 memory consumption」主要調整 garbage collector 的回收方式。

 

JavaScript Heap Size Reduction

There is an inherent trade-off between garbage collection throughput, latency, and memory consumption. For example, garbage collection latency (which causes user-visible jank) can be reduced by using more memory to avoid frequent garbage collection invocations. For low-memory mobile devices, i.e. devices with under 512M of RAM, prioritizing latency and throughput over memory consumption may result in out-of-memory crashes and suspended tabs on Android.

 

Zone Memory Reduction

In addition to the JavaScript heap, V8 uses off-heap memory for internal VM operations. The largest chunk of memory is allocated through memory areas called zones. Zones are a type of region-based memory allocator which enables fast allocation and bulk deallocation where all zone allocated memory is freed at once when the zone is destroyed. Zones are used throughout V8’s parser and compilers.

 

實際使用 Macbook Pro , Windows 10 測試有明顯感受到開啟頁面的速度與可容納更多的分頁有提升許多。

 

預設停用 Flash,啟動 HTML5 支援

這個東西其實講超久了,只是都採用慢慢減少支援等這種溫和的方式,在此次改版直接就預設停用 Flash,並且正式預設開啟對 HTML5 的支援,並且給予 Top 10 的網站一年改進時間,我想這可能不見得會是最後通牒,但是一個技術時代進步的開始。

 

而在 Flash 最大影響的 Adobe 也開始將 Flash 改為 Animate 以 HTML5 為基礎的動畫工具。

 

給 Mr. 沙先生一點建議

彙整

分類

展開全部 | 收合全部

License

訂閱 Mr. 沙先生 的文章

輸入你的 email 用於訂閱