Closed kuseman closed 2 years ago
Hi,
The JRStyledTextParser performance does not have anything to do with the use of styles for text elements or with the use of style template files as you described above. It only has to do with the markup property or the now deprecated isStyledText property of a text element. Indeed, these can be declared in styles and inherited from there, but your example does not contain any of them.
But it is true that an optimization can be made to avoid attempting parsing XML if there is no < character in the text element value. In fact, this test can be made at a higher level.
Thank you for your suggestion. Teodor
Hi, we have reports that make use of styled text fields and the report filling is really slow. We have an external styles file included
And text fields like this
I've load tested one of our reports and recorded the process with JFR and the problem seems to boil down to really ineffective XML-parsing starting at https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/src/net/sf/jasperreports/engine/util/JRStyledTextParser.java#L250
Recording of allocations below is from a 2 minute test of generating the same report over and over again with an avg. of 5 second per generation. The SQL backing data source returns 1800 rows pretty much instant.
That's insane amount of allocations.
Is there anything we are doing wrong in our reports, can this be optimized?
Jasper: 6.18.1 JVM: OpenJDK 64-Bit Server VM (11.0.10+9-LTS, mixed mode) Java: version 11.0.10, vendor Azul Systems, Inc.
Fixed in #237