proxy getter inside vs outside

Benchmark created on


Setup

function outsideHandler(n,t){return n+t}
function testOutsideBind(n){return new Proxy({},{get:()=>outsideHandler.bind(void 0,n)})}

function testInsideBind(n){function t(n,t){return n+t}return new Proxy({},{get:()=>t.bind(void 0,n)})}

function testInside(n){function t(t){return n+t}return new Proxy({},{get:()=>t})}

Test runner

Ready to run.

Testing in
TestOps/sec
outside+bind
testOutsideBind(55).b(10)
ready
inside+bind
testInsideBind(55).b(10)
ready
inside
testInside(55).b(10)
ready

Revisions

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