-
Notifications
You must be signed in to change notification settings - Fork 601
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
Document.add(PdfPTable) is very slow in versions 1.3.32 and higher #1017
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Hi, unfortunately I can confirm this change causes the performance drop. This is because the redistribution of row height is not calculated once per row, but at least x^2. I will try find to a simple fix. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I will provide a fix today. |
@andreasrosdal This fix should resolve the performance problem.While testing I found another problem concerning missing lines when a row continues after a page wrap. I will create a separate ticket for it, as I believe it is not related this bug. |
Thank you, I have verified that the performance issue is solved now. |
I plan on making a new release of OpenPDF tomorrow with this fix included. |
@andreasrosdal Created #1021 |
I just finished testing our product this morning with the 1.3.36 release and it is working great. I certainly did not expect this issue to be analyzed, fixed and a new version released in less than 24 hours of posting this bug. Thank you for the fast resolution of this issue, it is much appreciated by me and my team. |
You are welcome. Now I have updated the latest master branch of OpenPDF to require Java 11. This is part of modernizing OpenPDF to work in Java 11+. It would be helpful if you could please test this development branch and see if OpenPDF works correctly in Java 11 for you. Thank you. |
Describe the bug
Document.add(PdfPTable) is very slow in versions 1.3.32 and higher
When creating a table with 10,000 rows versions 1.3.32 takes 90,000 ms
In previous versions, this would take less than 200 ms.
To Reproduce
Attached is a simple program to reproduce the issue.
slowPdfTableDemo.zip
To run it:
mvn clean package
cd target
java -jar slowPdfTableDemo-1.0-SNAPSHOT.jar
Expected behavior
In previous versions, this code would run in about 280ms.
Screenshots
None
System (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: