HN2new | past | comments | ask | show | jobs | submitlogin

Right, when I said "what's taking so long to run?", in my mind I was thinking there'd be one obviously slow thing that I could just remove or refactor, but it turned out that it wasn't any one single slow function/API causing the problem.

And yes, clearly removing the analytics code would have also solved the problem for me, and in many cases, removing code is the best solution.

In this particular case I couldn't remove any code because I was refactoring an open source library that a lot of people use. I wanted to try to make it better for input responsiveness in general, so people who use the library (and maybe don't know much about performance) will benefit for free.

Also, I wanted to help educate people about how tasks run on the browser's main thread, and how certain coding styles can lead to higher than expected input latency.

Anyway, glad you enjoyed the post!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: