https://issues.apache.org/bugzilla/show_bug.cgi?id=45373
Summary: Huge performance problems
Product: POI
Version: 3.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
I´m using jxl, jx:if-tags, inside jx:for. This (jx:if) is calling very often
the following function and so I have huge performance problems!
Used poi-version:
poi-3.0.2-FINAL
Class:
org.apache.poi.hssf.usermodel.HSSFSheet
Method:
public void shiftRows(int startRow, int endRow, int n, boolean
copyRowHeight, boolean resetOriginalRowHeight) {
Ist improvement:
----------------
line-number 1199: problem is call of row2Replace.getLastCellNum() on each
iteration:
for ( short col = row2Replace.getFirstCellNum(); col <=
row2Replace.getLastCellNum(); col++ )
why you don´t use following code instead? I save 30 % time!
short col=row.getFirstCellNum();
short lastCol=row.getLastCellNum();
while (true){
if(col > lastCol){
break;
}
IInd improvement:
----------------
line-number 1228: I removed the following code because I never work with
comments, and most other people also. And I save again about 30 %. Perhaps you
should make this optional by using boolean parameter?
HSSFComment comment = getCellComment(rowNum, col);
if (comment != null) {
comment.setRow(rowNum + n);
}
With this 2 changes now I need 20 secs instead of 1 min!
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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]