Symbol.keyFor() vs Symbol.prototype.toString().slice(7, -1)

Benchmark created on


Setup

const BASE_SYMBOL = Symbol("KEY");

Test runner

Ready to run.

Testing in
TestOps/sec
Symbol.keyFor()
Symbol.keyFor(BASE_SYMBOL);
ready
Symbol.prototype.toString().slice(7, -1)
BASE_SYMBOL.toString().slice(7, -1)
ready

Revisions

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