Script Preparation code:
AخA
 
var POWERS = [
        1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,
        65536,131072,262144,524288,1048576,2097152
        
];
Tests:
  • Table lookup

     
    let p = 15;
    let x;
    if (p > 20) {
        x = Math.pow(2,p);
    } else {
        x = POWERS[20];
    }
  • Math.pow

     
    let p = 15;
    let x;
    x = Math.pow(2,p);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Table lookup
    Math.pow

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 10 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125 on Windows
View result in a separate tab
Test name Executions per second
Table lookup 11681200.0 Ops/sec
Math.pow 6886847.5 Ops/sec