This document discusses techniques for analyzing the performance of mobile web applications. It covers challenges like network variability, different device hardware, and continuous integration. Approaches mentioned include benchmarking, injecting instrumentation, emulation, and remote inspection. Strategies suggested are reducing complexity, replicating analysis on desktop, and tweaking at the system level. Tools mentioned include the Nexus One, Gingerbread, PhantomJS, and headless WebKit. The document provides examples and caveats for analyzing areas like network traffic, graphics commands, garbage collection, and JavaScript parsing.
24. Real-time Sni ng + Postprocessing
WebFrame::startLoadingResource WebCoreResourceLoader::AddData(...)
waiting data transfer
WebCoreResourceLoader::Finished()
42. Keyword vs Identifier
instanceof instanceComponent
requires
checking
9 chars
a g h j klmopqxyz
43. Function Parsing
Analyze the syntax
foobar = function(x, y, z)
Mark the position of
{ function ‘foobar’
....
}
foobar(x, y, z);
Compile and run the
function ‘foobar’
47. Deploy-time Pruning
Never used
function createList(position, options) {
... some code ...
}
createList({ x: 0, y: 0});
createList({ x: 0, y: 100});
48. Avoid Object Construction
Create + Destroy
startTime = new Date(); startTime = Date.now();
// heavy processing // heavy processing
elapsed = (new Date()) - startTime; elapsed = Date.now() - startTime;
49. Irrelevant Platforms
Does not apply in Mobile
if (typeof object.attachEvent !== 'undefined') {
// Internet Explorer < 9
object.attachEvent('on'+ev, createWrapper(func));
} else {
// DOM Level 3
object.addEventListener(ev, func);
}