Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
Chrome 84
Linux
Desktop
4 years ago
Test name Executions per second
Add using Decimal.js 731.3 Ops/sec
Add using native numbers 1985807.9 Ops/sec
Add using numerical strings parsed with Number 4361.5 Ops/sec
Add using numerical strings parsed with parseFloat 2741.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Add using Decimal.js

  • Add using native numbers

  • Add using numerical strings parsed with Number

  • Add using numerical strings parsed with parseFloat