Run details:
Mozilla/5.0 (Linux; Android 11; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36
Chrome Mobile 89
Android
Mobile
3 years ago
Test name Executions per second
Multiply using Decimal.js 325.9 Ops/sec
Multiply using native numbers 1209063.0 Ops/sec
Multiply using numerical strings parsed with Number 1438.3 Ops/sec
Multiply using numerical strings parsed with parseFloat 968.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Multiply using Decimal.js

  • Multiply using native numbers

  • Multiply using numerical strings parsed with Number

  • Multiply using numerical strings parsed with parseFloat