Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
normal function with/without arguments/eval
(version: 1)
hypothesis: having arguments/direct eval in a function body makes it slower(?)
Comparing performance of:
normal vs eval vs arguments
Created:
9 months ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let bigNum = 1e7 let a = function closure() { let big = Array(bigNum).fill(2) let big2 = Array(bigNum).fill(2) let big3 = Array(bigNum).fill(2) return function(a, b) { true || true return a + b } }() let b = function closure() { let big = Array(bigNum).fill(2) let big2 = Array(bigNum).fill(2) let big3 = Array(bigNum).fill(2) return function(a, b) { true || eval('never reached') return a + b } }() let c = function closure() { let big = Array(bigNum).fill(2) let big2 = Array(bigNum).fill(2) let big3 = Array(bigNum).fill(2) return function(a, b) { true || arguments.callee return a + b } }()
Tests:
normal
a(1,2,3,4,5,6,7)
eval
b(1,2,3,4,5,6,7)
arguments
c(1,2,3,4,5,6,7)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
normal
eval
arguments
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
normal
207.1M/s
eval
184.8M/s
arguments
183.7M/s
View exact numbers
Test name
Executions per second
✓
normal
207,100,544 Ops/sec
eval
184,830,432 Ops/sec
arguments
183,700,608 Ops/sec
Related benchmarks
Explicit call vs apply
Ramda flatten function VS Array.prototype.flat
rest args vs arguments, spread vs apply
Inline JS vs Single Function vs Function Composition
global function or function in function
callbacks: inline function vs global
callbacks: inline function vs inline arrow vs global
Comments
Confirm delete:
Do you really want to delete benchmark?