eval vs Function vs code

Benchmark created on


Setup

const a = 2;

Test runner

Ready to run.

Testing in
TestOps/sec
eval
eval('a+2');
ready
Function
Function('a', 'a+2')(a);
ready
code
a+2;

ready

Revisions

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