News for hackers. Stuff that matters.
Re:Using event capturing to improve Basecamp page load times by JBiserkov on Wednesday March 14, 2012 @12:38PM (#3703937)
The last paragraph that should be on top:

"If you’re looking to speed up page load times in your own projects, start by profiling. Then identify the hotspots and defer them until the furthest point of intent — where you know the user is about to perform the action you need to set up."

Re:Using event capturing to improve Basecamp page load times by newman314 on Wednesday March 14, 2012 @01:28PM (#3704216)
It's too bad that the article did not measure how long it takes for the action to fire when the user does perform the action after refactoring.

I would think that it's a bad user experience to experience a big pause right when they want to do something. Sure the page loads faster but a noticeable pause after a click would be tremendously annoying and contribute to the "laggy" feel.

Re:Using event capturing to improve Basecamp page load times by sstephenson on Wednesday March 14, 2012 @01:32PM (#3704246)
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.

Re:Using event capturing to improve Basecamp page load times by joshuacc on Wednesday March 14, 2012 @01:42PM (#3704319)
Excellent article. Do you mind going into what tools/techniques you used to do the profiling?
Re:Using event capturing to improve Basecamp page load times by sstephenson on Wednesday March 14, 2012 @01:52PM (#3704375)
Sure 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.

Re:Using event capturing to improve Basecamp page load times by masklinn on Wednesday March 14, 2012 @03:00PM (#3704764)
>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.

Re:Using event capturing to improve Basecamp page load times by sstephenson on Wednesday March 14, 2012 @03:11PM (#3704818)
Because I didn't know about it :) Great tip!
Re:Using event capturing to improve Basecamp page load times by smickie on Wednesday March 14, 2012 @04:58PM (#3705328)
What tools do you use to profile js on a webpage?
Re:Using event capturing to improve Basecamp page load times by timothya on Wednesday March 14, 2012 @05:43PM (#3705535)
Profiling is built into the developer tools in Google Chrome.