Overview
Discover how to effectively use jsPerf for JavaScript performance testing in this JSConf EU 2011 talk. Learn about benchmarking pitfalls, the importance of testing across multiple browsers, and six key points for accurate results. Explore common problems with tests, proper test case setup, variable resetting, and handling asynchronous operations. Gain insights into comparing methods, dealing with test randomness, and avoiding unexpected browser features that can skew results. Master the art of creating reliable JavaScript benchmarks to optimize your code performance.
Syllabus
Intro
Statistics
Benchmarking pitfalls
Test in all browsers
The 6 bullet points
Common problems with tests
Running tests
Comparing methods
Test case example
Reset variables
Test case
Test rerun
Test randomness
Never just asynchronous
synchronous tests
multi test case
dumb cleanup
benchmarkjs
testcount
unexpected browser features
Taught by
JSConf