Real-time Sni ng + Postprocessing
WebFrame::startLoadingResource WebCoreResourceLoader::AddData(...)
waiting data transfer
WebCoreResourceLoader::Finished()
Keyword vs Identifier
instanceof instanceComponent
requires
checking
9 chars
a g h j klmopqxyz
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’
Deploy-time Pruning
Never used
function createList(position, options) {
... some code ...
}
createList({ x: 0, y: 0});
createList({ x: 0, y: 100});
Avoid Object Construction
Create + Destroy
startTime = new Date(); startTime = Date.now();
// heavy processing // heavy processing
elapsed = (new Date()) - startTime; elapsed = Date.now() - startTime;
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);
}