localStorage vs sessionStorage vs object

Benchmark created on


Preparation HTML

<script></script>

Setup

localStorage.setItem("token", "12345");

sessionStorage.setItem("token", "12345");
  
var STORAGE = {
 token: "12345"
};

Test runner

Ready to run.

Testing in
TestOps/sec
object
var value = STORAGE.token;
ready
sessionStorage
var value = sessionStorage.getItem("token");
ready
localStorage
var value = localStorage.getItem("token");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.