phpexcellibxl

libXL with php_excel Read Performance


I have to read large Excel Files in PHP (>2M Cell). I have tried the PHP Class phpExcel, but the Performance is worse. Now, i found the libXL Libary (http://www.libxl.com/) und the PHP Wrapper php_excel for it.(https://github.com/iliaal/php_excel).

Has anyone experience with the read performance and memory/cpu usage?


Solution

  • Using exactly this combination - libxl + php_excel. This is the fastest option I was able to find, memory usage is also somewhat better than in phpExcel case. I did the comparison (about a year ago), it's table creation (write), but you should get the picture. At least memory usage per cell should be the same.

    Populate table: N rows, 16 columns each row, 10-16 character long value in each cell.
    
    *** PHPExcel:
    
    Without caching:
    Rows | Time | Memory usage | Memory per cell
    10k  | 70s  | 370 Mb       | 2.4 Kb
    50k  | 10m  | 1790 Mb      | 2.4 Kb
    
    Caching (cache_in_memory_gzip):
    Rows | Time | Memory usage  | Memory per cell
    10k  | 110s | 181 Mb        | 1.2 Kb
    50k  | 10m  | 865 Mb        | 1.1 Kb
    100k | 20m  | 1718 Mb       | 1.1 Kb
    
    Caching (cache_to_disc):
    Rows | Time | Memory usage | Memory per cell
    10k  | 90   | 218 Mb       | 1.4 Kb
    
    *** LibXL:
    
    Rows | Time | Memory usage  | 
    100k | 25s  | 1100 Mb       | 
    200k | 50s  | 2200 Mb       | 
    300k | 85s  | 3500 Mb       |