-
Notifications
You must be signed in to change notification settings - Fork 424
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
~150 millisecond hotspot under the picocli.CommandLine$Help$Ansi$Text.toString method #1975
Comments
My previous comment was wrong. This And the first thing |
What would the proper fix for this be? Should the Or should the |
Thank you for raising this and thank you for the investigation! For the solution, I'd go even lower level and cache the result of I don't like caching the result of |
do I get it right that if you have jansi on classpath this change does not change things - its only if you do not include jansi? |
@maxandersen I'm not sure to be honest. |
10 runs of 'jbang' aversge startup does not seem to change with 4.7 vs 4.6. |
In my program's initialization, there's a bunch of
Class.forName
calls, half of them seem to come frompicocli's CommandLine$Help$Ansi$Text.toString
method. It appears to be looking forjansi
classes. The above screenshot shows this is taking about 150 milliseconds to complete. I can confirm that passing in-Dpicocli.ansi=false
to the Java commandline works around this issue. I'm running this on Windows.https://github.com/remkop/picocli/blob/051a51d07ef917913aec53759ceeac0893591617/src/main/java/picocli/CommandLine.java#L17800-L17829
I don't have
org.fusesource.jansi
on my classpath. I wouldn't expect the total time for theisJansiConsoleInstalled
method to take 150 milliseconds, unless it was repeatedly called in a loop, which I don't think it is. It should complete instantaneously.Anyone know what's going on here?
The text was updated successfully, but these errors were encountered: