Simplifying vs Complicating Performance Optimization

Simplifying your code for performance can and should be done throughout development. Complicating your code for performance should only be done after profiling has been done and bottlenecks have been identified.

During the entire development process it’s good to constantly refactor.  Reducing all extra steps and other cruft in a programs logic can not only improve performance but it makes your code more readable and decreases file size.  Reducing it to it’s poetic essence isn’t what the Knuth was talking about when he said “Premature optimization is the root of all evil.”

Once the code is working and perfomance analysis is done (I use dynatrace), certain bottlenecks appear.  Optimizing these issues sometimes requires complicating your code in order for it to perform better.  Here are some examples from a nice post by Doug Avery.  Replacing jQuery with native javascript can take out extra executions in a heavily trafficked loop but at the cost of increasing your code and making it less readable.  That’s why it’s critical that you only do this complicating type of optimization after performance analysis has been done and bottlenecks identified.

Using Landing Pages to Improve Performance

The landing page, that simple inviting page that beckons the user to explore.  It gives a taste of what’s to come and it builds up to what’s behind the curtain.  The calming simplicity tells the user to brace yourself for the site you’re about to view.  Their are several UX reasons for having one, but they also offer an opportunity to greatly improve your site’s performance. Here are two ways:

preloading files

measuring speed for future consideration