https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

--- Comment #13 from Manuel Koller <[email protected]> ---
I was tracking down a slow Excel export and I came across this ticket. There
seems to be at least one optimisation that could help speed up things.

Profiling one very slow export, I noticed that about 60% of the time was spent
calling sheet.getMergedRegions() from SheetUtil.getCellWidth(Cell cell, int
defaultCharWidth, DataFormatter formatter, boolean useMergedCells).

The getCellWidth method is called for each cell in the sheet. Presumably the
return value of sheet.getMergedRegions() doesn't change during an
autoSizeColumn() call. If the return value from getMergedRegions() is either
passed in or otherwise cached, then this would probably speed things up
considerably.

The passing in approach is easy but would probably clutter the interface too
much. But caching the sheet.getMergedRegions() within sheet instances seems
more complicated as presumably each implementation would have to handle that
separately. As the calls are likely to be made for each column in the sheet,
the solution should cover that case, too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to