Bug 54282 - [PATCH] Fix to speed up opening xslx spreadsheets
Summary: [PATCH] Fix to speed up opening xslx spreadsheets
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-dev
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-11 17:52 UTC by Jan
Modified: 2013-01-22 23:38 UTC (History)
1 user (show)



Attachments
Patch for avoiding repeated calls to size function (796 bytes, patch)
2012-12-11 17:52 UTC, Jan
Details | Diff
Screenshot from profiler session showing bottleneck (132.92 KB, image/png)
2012-12-11 17:53 UTC, Jan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan 2012-12-11 17:52:04 UTC
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.
Comment 1 Jan 2012-12-11 17:53:00 UTC
Created attachment 29745 [details]
Screenshot from profiler session showing bottleneck
Comment 2 Nick Burch 2012-12-12 00:48:26 UTC
Thanks for this, committed in r1420501.