You can create functions on the fly in Javascript through the new Function constructor (as an alternative to eval()). Are there any performance issues with that? Find out!
Comparing performance of: Real function vs Dynamic function vs Evaluated function
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
Real function
Dynamic function
Evaluated function
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.39