localStorage writing

JavaScript performance comparison

Revision 30 of this test case created

Info

Tests the different writings to localStorage.

Preparation code

<script>
  localStorage.clear();
</script>
<script>
Benchmark.prototype.teardown = function() {
    localStorage.clear();
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Writing to localStorage via property
localStorage.foo = "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }";

 
pending…
Writing to localStorage index
localStorage['foo'] = "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }";
pending…
Writing to localStorage with setItem
localStorage.setItem("foo", "body { background: blue; margin: 10px; padding: 10px; color: black; text-decoration: none; }");
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:

0 comments

Add a comment