Stacktrace capture performance penalty

Benchmark created on


Setup

function normal() {
	return "no stacktrace";
}

function capture() {
	let obj = Object.create(null);
	Error.captureStackTrace(obj);
	return obj.stack;
}

function err() {
	return (new Error).stack;
}

Test runner

Ready to run.

Testing in
TestOps/sec
No capture
let result = normal();
ready
captureStackTrace
let result = capture();
ready
Error#stack
let result = err();
ready

Revisions

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