localStorage vs globals (v10)

Revision 10 of this benchmark created on


Description

Just a test to check performance of global storage vs global variables

Preparation HTML

<script>
  var athena = {};
  athena.currentNode = 'Dev';
  localStorage.setItem('currentNode', 'DEV');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
using global
var count = 0;
for (var i = 0; i < 1000; i++) {
  if (athena.currentNode == 'DEV') {
    count++;
  }
}
ready
using localStorage
var count = 0;
for (var i = 0; i < 1000; i++) {
  if (localStorage.getItem('currentNode') == 'DEV') {
    count++;
  }
}
ready

Revisions

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