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 Chief Product Officer at Blackfire. He's an engineer, but probably one of the least "tech" people in the company. He's wearing many hats, from product management to marketing and sales. He loves the beauty of simple solutions that solve actual problems.