-
-
Notifications
You must be signed in to change notification settings - Fork 918
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
Stop recompiling pattern at runtime #1642
Comments
Thanks for the feedback: this should be fixed with last snapshot (1.2024.0beta2). We would appreciate it if you could confirm whether you notice any changes. While we suspect that regexes may not have been recompiled on every call due to internal caching mechanisms for frequently used regex patterns, we cannot confirm this with certainty. Therefore, implementing this change was a prudent decision. |
Hi @arnaudroques , I'm not sure of which cache you are talking about (there is none in the JVM) but it is fixed now, plantuml is no more the slowest part in the site rendering, thanks a lot. |
Many thanks for the feedback, I was wrong about my caching statement. Glad it works better now :-) Since we are talking about perf, we could easily add another optimisation here: most of the regex starts with Any though on this one? |
Looks not bad but it is mainly compilation cost which was huge so guess you fixed the 80%, up to you to play with the remaining 20 ;). |
Is your feature request related to a problem? Please describe.
https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/text/TLineType.java#L56 uses pattern matching but not from a precompiled pattern, from a new pattern for each call which makes the overall processing slow when having a lot of of "big" graphs.
Describe the solution you'd like
Move all regexes to static
Pattern
instance and just use theMatcher#matches
instead ofString.matches
method.Describe alternatives you've considered
Fork?
Additional context
Getting that from asciidoctorj integration - not important but gives the context.
Here is the interesting thread dump stack:
The text was updated successfully, but these errors were encountered: