Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Callback vs Proxy apply
Compare extension techniques using callback and proxy. For sure callbacks should be faster, but when Proxy is considered as production solution so be aware of performance penalty
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
Callback
18.8M/s
Proxy.apply
7.7M/s
View exact numbers
Test name
Executions per second
✓
Callback
18,844,770 Ops/sec
Proxy.apply
7,656,402 Ops/sec
Script Preparation code:
// callback const callbackBase = (cb) => { return cb() + 1; }; globalThis.callbackTest = () => callbackBase(() => 2); // proxy const proxyBase = (a) => { return a + 1; }; globalThis.proxyTest = new Proxy(proxyBase, { apply: ( wrappingTarget, thisArg, args, ) => { return wrappingTarget.apply(thisArg, [2]); } });
Tests:
Callback
callbackTest();
Proxy.apply
proxyTest()