Summary: | [PATCH] Fix to speed up opening xslx spreadsheets | ||
---|---|---|---|
Product: | POI | Reporter: | Jan <jan.stette> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | warwick_burrows |
Priority: | P2 | ||
Version: | 3.9-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
Patch for avoiding repeated calls to size function
Screenshot from profiler session showing bottleneck |
Created attachment 29745 [details]
Screenshot from profiler session showing bottleneck
|
Created attachment 29744 [details] Patch for avoiding repeated calls to size function I'm seeing Apache POI being very slow when opening certain xslx/XSSF spreadsheets. After profiling, it turns out that around half the time was spent calling CTColsImpl.sizeOfColArray() inside ColumnHelper.addCleanColIntoCols(). See the attached screenshot from my profiler session. The fix is trivially simple, it just pulls the call to sizeOfColArray() outside of the loop. On some spreadsheets, this reduces the time of loading the spreadsheet to half of the original time.