Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
new Function vs function pre
(version: 0)
Comparing performance of:
new Function vs regular
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var newFunc = new Function("x", "return (x ** 2).toString(36).substring(7).includes('x');"); var regular = function(x) { return (x ** 2).toString(36).substring(7).includes('x');; } var i = 100000 while (i--) { newFunc(i); regular(i) }
Tests:
new Function
newFunc(10);
regular
regular(10)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
new Function
regular
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
eval vs new Function (Sample JS Functions)
eval vs new Function vs function(Sample JS Functions)
new Function vs function(Sample JS Functions)
eval vs new Function vs function(Sample JS Functions)2
Comments
Confirm delete:
Do you really want to delete benchmark?