CPAN::Forum
Spreadsheet-ParseExcel - Book parsing vs memory and cpu usage
| Posted on Thu Mar 27 08:18:29 2008 by nmatchan |
| Book parsing vs memory and cpu usage |
|
I'm using Spreadsheet::ParseExcel within a cgi script to allow others to upload 'query lists' to a 'mysql' server which then generates a HTML report of where the queried items are located.
This module works fine until someone uploads a large Workbook (20MB Plus) which result in Apache abending due to running out of memory (1.8GB before I terminated the cgi process).
This issue seems to be that when a file is "read in" using
"Spreadsheet::ParseExcel::Workbook->Parse('fileName')", all sheet's are parsed before the method returns which burns memory & CPU. This is necessary if you want to access all the sheets within the Workbook but not if you only require access to one or two, small, specific sheets.
I've tried using Spreadsheet::ParseExcel::Simple and the external 'cell' handler documented in other threads and although they do help, it not enough to stop the terminal memory issue.
Short of getting my end users to delete all unnecessary sheets before uploading the workbook, is there any way of getting the module to parse/process a specific sheet name or list of sheet names within a workbook and ignore/skip the other sheets at parsing time?
eg. Spreadsheet::ParseExcel::Workbook->Parse($file, sheets="Assets,EndOfLife"))
Thanks in advance,
Neil M
|
| Write a response |
(7)
]