Performance & Optimization

System performance optimization, monitoring, caching strategies, and technical performance insights.

10 Posts
Oct 31, 2014
2 minutes

Top 3 Reasons to Avoid Magento's getFirstItem()

Magento utilizes a lot of helper functions as well as the Zend Framework and ORM. While this makes things easier to develop, there are areas where this actually makes getting things done more difficult. The very first area that comes to mind is when you are trying to only retrieve a single record from the database. If you were to search Google for the proper way to do this, you would do the following, assuming $collection is your collection object.

Aug 18, 2014
2 minutes

PHP serialize/unserialize is faster than json_encode/json_decode

One of the things that I tend to focus on with a website is how quickly everything loads and executes. However, that focus can sometimes get to be a bit too narrow, only considering the performance of those resources that are required for the initial page load, and not for other dynamic aspects of the site. We recently implemented New Relic on one site, and gained much insight into how long each aspect of our site took to load, and how long each of the most popular requests took to execute.

Jul 14, 2014
2 minutes

Performance Testing with Siege

One of the most important things to consider when evaluating a website is how well the site performs under load. For many eCommerce websites, there is a higher volume of traffic to the website on Cyber Monday, which is the Monday after Thanksgiving. One of the sites I work with typically sees traffic to its site quadruple on this one day of the year compared to the average traffic. However, when you anticipate something on your site making it to the front page of Digg or Slashdot, your site can easily see a jump of an order of magnitude (10X) or more.

May 19, 2014
4 minutes

Google Analytics Site Speed is a bit Unreliable

Google Analytics will now allow site owners to track the performance of their websites with real live traffic. This is a nice feature that lets you understand just how long it takes for the average visitor to your site to see the fully complete version of your website. While this sounds like a great tool that will give you an accurate view of yoru website’s performance, it does not tell the full story. You can access the Site Speed section of Google Analyics under the Behavior>Site Speed>Overview section. Please be aware that not all visitors will send this information, so you will have to have a certain amount of traffic to your site before you will get any information in this section at all.

Apr 29, 2014
2 minutes

Avoid jQuery.bind()

When chasing down performance issues, you never know what kind of problems you will find. I was looking for something that would cause jitter when scrolling on the page. After looking at the custom code that runs on every scroll event, I still had not found a reason for the jitter. Looking at the JavaScript CPU profile when scrolling in Chrome showed that there was an overwhelming majority of the time spent in a function in the Prototype JS library.

Apr 28, 2014
2 minutes

Improve jQuery Performance With $().addClass()

When looking at things that make a website seem sluggish, you might assume that the most popular JavaScript framework out there always does things in the most efficient manner. However, as I have found, jQuery does not always produce the best performance due to it having to support many different browsers with version 1.x. As a general rule, instead of setting CSS attributes directly on the selected nodes, I prefer to instead add and remove classes on those nodes instead, as it seems to perform much better.

Apr 25, 2014
4 minutes

Optimizing Website Load Time

Assuming you have already done a few things to improve the page load time of your website, such as using a Varnish caching server, GZipping your content in transit, minifying that same content, and turning on all caching options that Magento or your web platform of choice have available, there is still more you can do. When it comes to website performance, the 80/20 rule definitely applies. 80% of the performance tweaks that you perform will only provide a miniscule improvement to the site load time, while the 20% of things you do make a big difference. Any time I am looking to speed of the performance of a website, I seek those 20% items that give you the biggest bang for your buck.

Apr 24, 2014
2 minutes

Optimize Magento Time To First Byte

When looking at the performance of your site, waterfall charts are one of the first places you should investigate. The first thing that is represented on these charts is that the HTML for the website is the first resource that is downloaded every time.

As a result of being the first resource downloaded every time, this is the logical first place to look to improve the performance of your Magento website. There are a few ways to make sure that the page downloads more quickly, and they all involve making sure that the file size is as small as possible.

Apr 14, 2014
One minute

Varnish and Magento Performance Mystery

One of the things that you think you will solve when you implement a Varnish caching server in front of a Magento website is performance problems. However, this is not necessarily the case.

When I set Varnish up to cache content in front of my Magento website, I get what seems to be much improved performance. If I run a few tests in the developer tools of Chrome, it seems that the waterfall chart makes sense and the data is loaded appropriately and in a timely manner with the main HTML being downloaded in about 300ms.

Mar 25, 2014
2 minutes

Magento Cache with Cache Disabled

One of the things that I find quite annoying with a web platform is when you configure it to do one thing, and it does something different. Magento is an eCommerce software platform that many of the leading eCommerce websites use for their web stores.

Magento

Magento comes in two different flavors, a paid enterprise edition as well as a open-source community edition. The enterprise edition allows you to utilize the built-in full-page caching mechanism, while the community edition does not include a full-page caching solution.