Increasing performance of an Excel import feature

By Christophe Dujarric, on Jan 29, 2016

Jorge (@jorgelbgm) is involved in many PHP activities, and a Project Management Committee Member for Apache Nutch.

One of his activities involved working on a Symfony2 application for a customer, supposed to import Excel files. The size of those files was rather small at the beginning, but quickly grew to 5Mb. Soon, he realized that the application wasn’t able to handle such files anymore.

Using Blackfire, Jorge figured that the library choice which was made at the start of the project couldn’t fit anymore. Selecting a new one, he used Blackfire again to tweak it and get an optimal configuration for his specific use case.

Performance with the old library:

Wall Time 2min 47s
CPU Time 2min 46s
I/O Time 946ms
Memory 1GB (!!)

Performance with the new, tweaked library:

Wall Time 13.3s
CPU Time 13.2s
I/O Time 124ms
Memory 16.9MB (!!!)

In such a context, numbers quickly get tremendous proportions. In percentage, that represents an astounding improvement of 92% less time, and 98,3% less memory usage!

Jorge wrote an article detailing his research during the #FireUpMyMac contest, which you can read in full here.

Christophe Dujarric

Christophe is the Product guy at Blackfire/SensioLabs. He has been working in several start-up companies, helping them to make and sell products out of technologies. He’s involved in every step of the product’s lifecycle, from strategy to design and sales, and loves to coach on product management methods.