2015年4月23日星期四

Stephan Hochdörfer: Processing CSV files in a memory efficient way


In his latest post Stephan Hochdörfer shares some of his experience in using the PHPExcel tool to parse CSV files and the performance issues he ran into. Fortunately, he found a solution...in the form of another library.




A little while ago I had to dive deeper into the performance optimized usage of PHPExcel. Our users are uploading files like Excel or CSV with a lot data to process. Initially we used the PHPEXcel instance without any tuning of the default configuration which lead to heavy memory issues on relativly small files. So I had to avoid reading all file content at ones to the buffer (like file_get_contents does).



In my research mainly optimizing the usage of PHPExcel I came across a tiny library I am grown really fond of. It is called Goodby/CSV. Both tools have a very well grounded documentation to read in and understand the basics and the usage.




He describes some of the main differences between the two tools and includes some basic benchmark results comparing memory consumption and overall speed.


Link: https://blog.bitexpert.de/blog/processing-csv-files-in-a-memory-efficient-way/

没有评论:

发表评论