Split vs no split (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
  var obj1 = {key: 'Card-101'};
  var obj2 = {type: 'Card', index: 101};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Split
obj1.key.split('-')[0] === 'Card'
ready
Split + parseInt
parseInt(obj1.key.split('-')[1]) === 101
ready
No split
obj2.type === 'Card'
ready

Revisions

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