7 ms·
At that point it's much more about feel than a hard time measurement. After implementing deferred initialization I asked myself "does reordering feel laggy?" a
by sstephenson 15y ago
At that point it's much more about feel than a hard time measurement.
After implementing deferred initialization I asked myself "does reordering feel laggy?" and the answer was no. If it had felt laggy then I'd have started profiling again.
- joshuacc 15y agoExcellent article. Do you mind going into what tools/techniques you used to do the profiling?
- sstephenson 15y agoSure thing. For high-level measurements I use good old "new Date().getTime()". One call before, one call after, subtract the former from the latter and log it to the console. When I want to dig deeper, I go to the WebKit Inspector's Profile tab. You can turn it on or off through the UI, or use console.profile()/console.profileEnd() in your code to control it programmatically.
- masklinn 15y ago>For high-level measurements I use good old "new Date().getTime()". One call before, one call after, subtract the former from the latter and log it to the console. Why not use `console.time` and `console.timeEnd` for that? They probably have the same resolution as the underlying date object and they're significantly less of a hassle.
- sstephenson 15y agoBecause I didn't know about it :) Great tip!