manual passthrough signature for arrow functions

Benchmark created on


Setup

const f = o => Object.getOwnPropertyNames(o);
const t1 = obj => !f(obj) || obj;
const t2 = obj => [f(obj), obj][1];
const t3 = obj => (void f(obj)) ?? obj;
const t4 = obj => (NaN == f(obj)) || obj;
const t5 = obj => (NaN === f(obj)) || obj;

Test runner

Ready to run.

Testing in
TestOps/sec
obj => !f(obj) || obj
t1({ foo: 1 })
ready
obj => [f(obj), obj][1]
t2({ foo: 2 })
ready
(void f(obj)) ?? obj
t3({ foo: 3 })
ready
(NaN == f(obj)) || obj
t4({ foo: 4 })
ready
(NaN === f(obj)) || obj
t5({ foo: 5 })
ready

Revisions

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