Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Firefox 49
Windows
Other
8 years ago
Test name Executions per second
Literal with push 134199.2 Ops/sec
Constructor() with push 145518.3 Ops/sec
Constructor(times) with push 96207.0 Ops/sec
Literal with index 141703.3 Ops/sec
Constructor() with index 141515.1 Ops/sec
Constructor(times) with index 171571.6 Ops/sec
Literal with push and overflow 136780.5 Ops/sec
Constructor() with push and overflow 141507.3 Ops/sec
Constructor(times) with push and overflow 97361.2 Ops/sec
Literal with index and overflow 142752.6 Ops/sec
Constructor() with index and overflow 143544.8 Ops/sec
Constructor(times) with index and overflow 194902.5 Ops/sec
Script Preparation code:
Tests:
  • Literal with push

  • Constructor() with push

  • Constructor(times) with push

  • Literal with index

  • Constructor() with index

  • Constructor(times) with index

  • Literal with push and overflow

  • Constructor() with push and overflow

  • Constructor(times) with push and overflow

  • Literal with index and overflow

  • Constructor() with index and overflow

  • Constructor(times) with index and overflow