trycatch

Benchmark created on


Setup

let callbacks = [];

for (let i=0;i<100000;i++) {
	callbacks.push(() => {});
}

Test runner

Ready to run.

Testing in
TestOps/sec
try-catch for every item
for (let i=0;i<callbacks.length;i++) {
	try {
		callbacks[i]();
	} catch (e) {
		console.log(e);
	}
}
ready
one try-catch
try {
	for (let i=0;i<callbacks.length;i++) {
		callbacks[i]();
	}
} catch (e) {
		console.log(e);
}

ready

Revisions

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