Last active
December 26, 2015 13:39
-
-
Save derek/7159637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suite = new PerfSuite('pathogen prefix tree compression', { | |
assets: ['assets/gallery-pathogen-encoder-min.js'], | |
yui: { | |
use: ['gallery-pathogen-encoder'], | |
config: { | |
modules: { | |
'gallery-pathogen-encoder': 'assets/gallery-pathogen-encoder-min.js' | |
} | |
} | |
}, | |
global: { | |
setup: function () { | |
var Y = YUI(); | |
var paths = [ | |
'os/mit/media/p/content/interest-manager-min-1351823.js', | |
'os/mit/media/m/content_social/content-social-base-min-1496800.js', | |
'os/mit/media/m/content_social/content-share-buttons-int-min-1544525.js', | |
'os/mit/media/p/content/ad-controller-min-1545585.js', | |
'os/mit/media/m/content_photo/carousel-min-1458021.js', | |
'os/mit/media/m/comments/content-comments-min-1546415.js', | |
'os/mit/media/p/content/content-manager-min-1544454.js', | |
'os/mit/media/p/content/content-discoverer-min-1446986.js', | |
'os/mit/media/m/content_photo/content-ss-base-min-1545584.js', | |
'os/mit/media/p/content/request-manager-min-1544454.js', | |
'os/mit/media/p/content/perf-timeable-min-1191658.js', | |
'os/mit/media/p/content/instrumentation-min-1214752.js', | |
'os/mit/media/p/content/pane-manager-min-1544454.js', | |
'os/mit/media/p/content/next-scroll-min-1304262.js', | |
'os/mit/media/m/content_photo/content-ss-no-sv-min-1545584.js', | |
'os/mit/media/p/content/precog-manager-min-1483059.js', | |
'ss/strip_3.2.js', | |
'os/mit/media/m/sports/super-hero-min-1490675.js', | |
'os/mit/media/p/content/tag-manager-min-1294559.js', | |
'os/mit/td/mjata-0.4.3/mjata-lazy-modellist/mjata-lazy-modellist-min.js', | |
'os/mit/td/ape-location-0.0.5/af-locations/af-locations-min.js', | |
'os/mit/td/ape-location-0.0.5/ape-location-templates-location-list/ape-location-templates-location-list-min.js', | |
'os/mit/td/ape-location-0.0.5/ape-location-templates-location-panel/ape-location-templates-location-panel-min.js', | |
'os/mit/td/ape-location-0.0.5/af-location-panel/af-location-panel-min.js', | |
'os/mit/td/ape-af-0.0.95/af-pageviz/af-pageviz-min.js', | |
'os/mit/td/ape-af-0.0.95/af-poll/af-poll-min.js', | |
'os/mit/td/stencil-0.1.156/stencil-bquery/stencil-bquery-min.js', | |
'os/mit/td/stencil-0.1.156/stencil-swiper/stencil-swiper-min.js', | |
'os/mit/td/stencil-0.1.156/stencil-carousel/stencil-carousel-min.js', | |
'os/mit/td/stencil-0.1.156/stencil-fx/stencil-fx-min.js', | |
'os/mit/td/stencil-0.1.156/stencil-fx-collapse/stencil-fx-collapse-min.js', | |
'kx/yucs/uh3s/uh/28/js/uh-min.js', | |
'kx/yucs/uh3s/uh/27/js/menu_handler-min.js', | |
'kx/yucs/uh3s/uh/8/js/gallery-jsonp-min.js', | |
'kx/yucs/uh3s/uh/26/js/logo_debug-min.js', | |
'kx/yucs/uh3s/uh/26/js/timestamp_library-min.js', | |
'kx/yucs/uh3s/top_bar/js/5/top_bar-min.js', | |
'kx/yucs/uh3s/search/js/16/search-min.js', | |
'kx/yucs/uh3s/help/js/6/help_menu_v3-min.js', | |
'kx/yucs/uh3/location/js/7/uh_locdrop-min.js' | |
], | |
modules = {}, | |
loader, | |
groups; | |
paths.forEach(function (path) { | |
modules[path] = { | |
group: 'foo', | |
path: path | |
}; | |
}); | |
loader = new Y.Loader({ | |
combine: true, | |
require: paths, | |
groups: { | |
'foo': { | |
comboBase: 'http://l.yimg.com/zz/combo?', | |
root: '/', | |
combine: true | |
} | |
}, | |
modules: modules | |
}); | |
} | |
} | |
}); | |
suite.add({ | |
name: 'Original', | |
fn: function () { | |
Y.config.customComboBase = false; | |
Y.config.fullpathCompression = false; | |
loader.resolve(true); | |
} | |
}); | |
suite.add({ | |
name: 'with pathogen encoder', | |
fn: function () { | |
Y.config.customComboBase = 'http://l.yimg.com/gz/combo/cc/'; | |
Y.config.fullpathCompression = false; | |
loader.resolve(true); | |
} | |
}); | |
suite.add({ | |
name: 'with pathogen encoder and prefix tree compression', | |
fn: function () { | |
Y.config.customComboBase = 'http://l.yimg.com/gz/combo/cc/'; | |
Y.config.fullpathCompression = true; | |
loader.resolve(true); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment