Runtime Set generated vs Array fixed generated one time

Benchmark created on


Setup

const GLOBAL_ARRAY = ["A1", "B1"];
const oneString = "B1";

Test runner

Ready to run.

Testing in
TestOps/sec
Make set + check values
const mySet = new Set(GLOBAL_ARRAY);
mySet.has(oneString)
ready
Reuse array + check values
GLOBAL_ARRAY.includes(oneString)
ready

Revisions

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