Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Chrome 104
Linux
Desktop
2 years ago
Test name Executions per second
Add using Decimal.js 628.0 Ops/sec
Add using native numbers 3941185.0 Ops/sec
Add using numerical strings parsed with Number 5116.2 Ops/sec
Add using numerical strings parsed with parseFloat 3330.1 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