Script Preparation code:
Tests:
  • +someFloat.toFixed(4);

  • (Math.round(someFloat*10000)/10000);

  • ~~(someFloat * 10000) / 10000;

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    +someFloat.toFixed(4);
    (Math.round(someFloat*10000)/10000);
    ~~(someFloat * 10000) / 10000;

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Firefox 116 on Windows
View result in a separate tab
Test name Executions per second
+someFloat.toFixed(4); 14901734.0 Ops/sec
(Math.round(someFloat*10000)/10000); 1662973440.0 Ops/sec
~~(someFloat * 10000) / 10000; 1559779072.0 Ops/sec


;