Tests:
  • tilde

    x
     
    const a = 0.5;
    const b = 341;
    const c = ~~(a * b);
  • or

     
    const a = 0.5;
    const b = 341;
    const c = (a * b) |0;
  • floor

     
    const a = 0.5;
    const b = 341;
    const c = Math.floor(a*b);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    tilde
    or
    floor

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Chrome 97 on Linux
View result in a separate tab
Test name Executions per second
tilde 570161472.0 Ops/sec
or 566316352.0 Ops/sec
floor 4451844.5 Ops/sec