localStorage vs. Objects

JavaScript performance comparison

Revision 37 of this test case created by

Preparation code

<script>
  localStorage.foo = "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }";
  
  var FOO = {
   foo: "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }"
  };
  
  var value;
</script>
      
<script>
Benchmark.prototype.teardown = function() {
  console.log(FOO.foo, localStorage.foo);

};
</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
Reading from an object
value = FOO.foo;
pending…
Reading from localStorage
value = localStorage.foo
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