Ashish Dubey's blog

Thoughts on software performance

December 30, 2017

I love building software and in recent times something I’ve specifically loved about software is making it perform faster. Performance is a feature, an afterthought, an art, and so much people claim it to be. Lot has been said and done in this area of software engineering.

If I have to reflect on what I’ve learnt about performance of software, I will majorly focus on the role that it plays in driving the experience of using a software and also the basic principles behind improving software performance.

Now in recent years, I’ve spent some good amount of time on improving software performance. It was improving remote streaming performance at Browserstack and web performance at Grofers. Althought, the systems and the ways to make them perform better were quite different in both the cases, but a bunch of things remained the same.

One thing is performance improvement should be a cycle of measurement and implementation. You need to spend time in both the states to figure out what to implement next and obtain enough data to know when to stop. Measurement should give you insights of how your perf experiments have improved the experience for your users. Measurement should also give you enough information to determine bottlenecks in your system so you can attack the right problem.

Another thing I learned was that you should understand your system well so that you can decide what might work best for your system. Performance best practices are great but you combine the contextual knowledge of your system and the best practice to determine the best hack that will bring you closer to your performance goal. At times, best practices don’t even apply fruitfully on your system and you might need to do unconventional hacks to improve performance.

I realized this especially while improving the streaming performance at a point when best practices were in rarity. Not because there were not enough best practices for improving streaming performance in general, but this was after we applied best practices which were applicable for our system. And after that we were left alone chilling with our knowledge of the system and then we had to go brothers in arms for finding ways to improve the rate at which the video frames travelled from our data centers to the users’ browsers. Now one of the most effective ways in which we tried to achieve our goal involved working on network equipment rearrangement in our data center, leading to better quality video streams. Now this wasn’t something that we could find in the book of best practices.

Similarly, so many times at Grofers, we improved perceived performance of our website either by optimizing just the critical product flow. For instance, we are trying out ways in which we can make the website usable with smallest possible JavaScript and CSS, and without waiting for the third-party libraries that make up the foundation of our website, which involves React. Again, this was something that was very contextual for our website, which would allow our users to be able to use our site with less waiting. And actually that’s right there, the best practice that applies universally in all systems. Performance is a feature that improves user experience. And that’s the goal everyone is to be chasing - improving the user experience.

© 2022, Ashish Dubey