Summary: | autoSizeColumn(int i) swallows interrupted exception and resets interrupted flag | ||
---|---|---|---|
Product: | POI | Reporter: | derblaueklabautermann |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | derblaueklabautermann |
Priority: | P2 | ||
Version: | 3.16-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Bug Depends on: | 58896 | ||
Bug Blocks: |
Description
derblaueklabautermann
2016-11-25 00:16:24 UTC
Auto-sizing columns is one of the slowest functions in POI relative to what users expect (auto-sizing is nearly instantaneous in Excel even for large workbooks). Bug 58896 and past discussion on the dev@ mailing list discuss ways to improve the speed of calculating the best-fit-width for a column. Merged cells and rich text severely slow down the auto-size calculations (though our implementation of auto-sizing may not be much faster for plain text). If the problem resides in java.awt.font.TextLayout, maybe one way we could side-step this problem is by rewriting auto-sizing without TextLayout. POI does very little with threads or interruptions, so you're probably right that the interruption isn't originating from POI code. The only thing in POI that gets close to this is creating ThreadLocal variables in LocaleUtil and a few other locations. A quick grep didn't reveal an usages of Thread or interrupt outside of our test suite for unencrypted HSSF workbooks. Tried to analyze this, but I fear there is nothing we can do about it. It seems to happen deep inside AWT text handling and it seems to be related to how much time elapsed, i.e. doing the calls quicker allows more iterations until the state is cleared. So I believe AWT is doing some "time-based cleanup" here, so likely not much we can do. |