Exponentiation method comparison

Benchmark created on


Description

Compares Math.pow, the exponentiation operator, and chained use of the multiplication operator to raise a value to the power of seven.

Setup

const foo = Math.floor(Math.random() * 10);

Test runner

Ready to run.

Testing in
TestOps/sec
`Math.pow`
Math.pow(foo, 7);
ready
Exponentiation operator
void foo ** 7;
ready
Chained multiplication operator
void foo * foo * foo * foo * foo * foo * foo;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.