Skip to Main Content
Web 效能優化日誌 Volume 2
book

Web 效能優化日誌 Volume 2

by Stoyan Stefanov
July 2013
Intermediate to advanced content levelIntermediate to advanced
240 pages
4h 11m
Chinese
GoTop Information, Inc.
Content preview from Web 效能優化日誌 Volume 2
大約兩年前,行動 Gmail 團隊貼出了一篇文章,專門討論如何降低他們 HTML5 應用程
式的起始延遲(startup latencyhttp://googlecode.blogspot.com/2009/09/gmail-for-mobile-
html5-series-reducing.html)。這篇文章談到一個技巧,套用時會跳過 JavaScript 程式碼的
解析(parsing)與求值(evaluation),直到真正需要時再進行,方法是把它們放到註解
comments)中。SproutCorehttp://sproutcore.com/)的 Charles Jolleyhttp://www.okito.
net/)以快速嘗試這個技巧聞名。他使用這個技巧做了一些實驗(http://blog.sproutcore.
com/faster-loading-through-eval/),並且發現,類似的效能增益也能夠透過把程式碼放到
字串(string)中來獲得,而非將它們註解掉。在那之後,儘管有將它內建到 SproutCore
的承諾(http://www.okito.net/post/8409610016/on-sproutcore-2-0),這個技巧幾乎被遺忘
了。這是很可惜的事,因為它是惰性載入(lazy loading)很有趣的替代方式,很適合搭配
CommonJS 模組使用。
Text/JavaScript 類型的親密接觸
要理解這個技巧的運作方式,讓我們先看一
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

建構Android應用程式--使用HTML、CSS和JavaScript 第二版

建構Android應用程式--使用HTML、CSS和JavaScript 第二版

Jonathan Stark, Brian Jepson
高性能Spark

高性能Spark

Holden Karau, Rachel Warren
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9789862768587