https://bz.apache.org/bugzilla/show_bug.cgi?id=58885
--- Comment #2 from Javen O'Neal <[email protected]> --- Adding a merged region *safely* (without creating a potentially corrupted workbook) is inherently a O(n) operation, as it need to check all merged regions in the sheet for potential overlap. A merged region could be added unsafely (potential workbook corruption), but this should not be the default behavior. If adding multiple merged regions, it still requires O(n) time for each merged region addition. The checking could be deferred until a later time before saving the workbook, but wouldn't save any CPU cycles unless merged regions were added and removed between opening and saving the workbook. > which showed up as quite a sharp performance regression in one of our apps Could I get a rough number of merged regions in a sheet so I could profile this? I don't think there's much we can do to make the code faster, so we'll probably need to provide a method that bypasses validation. To make it crystal clear that using the bypassed-validation option can produce a corrupt workbook, I was thinking of calling it public int Sheet.addMergedRegionUnsafe(CellRangeAddress region), as the signature from comment 1 does not stress the consequences of checkForOverlapping=False. -- 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]
