basket.js versus browser cache
JavaScript performance comparison
Info
Does using basket.js improve caching performance over the browser cache?
Preparation code
<script src="https://github.com/addyosmani/basket.js/blob/gh-pages/dist/basket.full.min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
// Warm the cache
// A random URL from a CORS enabled data source
var url = "http://code.jquery.com/jquery.js";
basket.require({
url: url,
key: "jquery"
});
};
Benchmark.prototype.teardown = function() {
basket.clear();
var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (script.defer || script.src === url) {
script.parentElement.removeChild(script);
}
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
basket.js |
|
pending… |
Browser cache |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Mat Scales
- Revision 2: published by Mat Scales
- Revision 3: published by Mat Scales
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
- Revision 9: published by Mikey Cooper
0 comments