object literal vs json parse

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
object literal
 const obj={a:${Math.random()}, b:${Math.random()}};
 obj.a
ready
json parse
 const obj = JSON.parse(
    '{"a":${Math.random()}, "b":${Math.random()}}'
     );
      obj.a
ready

Revisions

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