This week and last week, I’ve been working with folk to add front-end performance logging to the app we’re working on. What’s the deal with front-end performance?
My 3 point summary of tracking performance:
- There’s a W3C API for performance (yay!)
- Time is a tricky thing (it’s it always). See the first link for more on that
- Performance definitely doesn’t have to end with your server logs
and there’re a few links my good buddy John alerted me to:
- Measuring Page Load Speed with Navigation Timing
- Understanding the Real-World Performance of your Web Application Across IE11 and Other Browsers
And a final tidbit – if you’re logging performance to an external service, you gotta make sure the load event had fired and finished, otherwise some performance metrics will be undefined. The setTimeout trick to win:
window.addEventListener('load', function(){
setTimeout(function() {
myLoggingFunction('Log some data', somePerformanceDataObject);
}, 0);
});