yui/yui3 — pull request #1581 by caridy (2014-01-24 23:57:50+00:00)
Title: [experimental][perf] disabling _populateCache() in loader in favor of an ondemand process

WIP / EXPERIMENT

Initial analysis:
---------------------

For a very basic page with all necessary modules in the page upfront, and a YUI().use(‘json-stringify’) call, will run under 20ms in chrome/desktop, but it takes more than 100ms in safari iPad3.

For a more complex example, adding more modules (app level modules), we can clearly see more degradation of the initialization, even though none of those modules are "used". Here is an example using modules from screen.yahoo.com (almost 400 new modules + the 407 modules from yui core):

http://jsbin.com/exoCAsIX/1/edit

For what we can see in the profiling, _populateCache(), which is executed once per Y instance, it will do a one time operation to digest all the raw metadata from YUI.Env.modules, passing them thru addModule() method that will do a basic expansion of the meta without doing the recursive computation to expand the dependencies, that happens on demand.

By using the loader built of this branch, we seed a good deal of improvement, and overall a constant time to use despited the number of extra modules added thru the metas, which is exactly what we are looking for.