Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve perfomance of cell evaluation #206

Closed
wants to merge 2 commits into from

Conversation

ledstellar
Copy link

The SXSSFRow.getRowNum() method is heavily used from various parts of the code (in particular, from the cell evaluation method). Current implementation of the method is using iterating over sheet rows to find the row number. This approach is ineffective for large sheets. The proposed patch stores the row number directly in the row object to improve method performance.

@@ -49,6 +48,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
// use Boolean to have a tri-state for on/off/undefined
private Boolean _hidden = UNDEFINED;
private Boolean _collapsed = UNDEFINED;
private int number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you call this rowNumber?

@@ -437,6 +437,10 @@ public SXSSFSheet getSheet()
{
return _sheet;
}

public void setNumber(int rownum) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be public - can't it be package-private? -- can it be called setRowNum? To match the name of getRowNum.

@ledstellar
Copy link
Author

Sure. Updated the patch to meet existing code style.

@asfgit asfgit closed this in c0ecc83 Dec 10, 2020
@pjfanning
Copy link
Contributor

Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants