localStorage versus browser cache

JavaScript performance comparison

Revision 7 of this test case created by

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  // A random URL from a CORS enabled data source
  var url = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js";
  
  // This can be synchronous for testing purposes
  var xhr = new XMLHttpRequest();
  xhr.open("GET", url, false);
  xhr.send();
  if (xhr.status === 200) {
    localStorage.test = xhr.responseText;
  }

};

Benchmark.prototype.teardown = function() {
  delete localStorage.test;

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
localStorage
var jquery = localStorage.test;
pending…
Browser cache
xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
xhr.send();
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.

0 Comments