Monomorphism

Benchmark created on


Setup

const add = (x, y) => x + y;
const addNumber = (x, y) => x + y;
const addString = (x, y) => x + y;
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const strings = ['a', 'b', 'c'];

Test runner

Ready to run.

Testing in
TestOps/sec
add
numbers.reduce(add, 0);
strings.reduce(add, '');
ready
addNumber + addString
numbers.reduce(addNumber, 0);
strings.reduce(addString, '');
ready

Revisions

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