localStorage vs globals (v12)

Revision 12 of this benchmark created on


Description

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

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
using global
var count = 0;
if (athena.CURRENT_NODE == 'DEV') {
    count++;
}
ready
using localStorage
var count = 0;
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.