Local Storage vs Session Storage

Benchmark created on


Setup

const key = 'testKey';
const value = 'testValue';
sessionStorage.setItem(k, v);
localStorage.setItem(k, v);

Test runner

Ready to run.

Testing in
TestOps/sec
Session storage
for (let i = 0; i < 10000; i++) {
  const value = sessionStorage.getItem('testKey');
}
ready
Local storage
for (let i = 0; i < 10000; i++) {
  const value = localStorage.getItem('testKey');
}
ready

Revisions

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