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

SafetyPropagationTransfer is slow because of heavy exception throwing #2942

Open
ash211 opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@ash211
Copy link
Contributor

ash211 commented Nov 5, 2024

What happened?

Running with gradle-jfr on one of my repos, I found that my compileJava task was throwing tens of thousands of exceptions:

Screenshot 2024-11-04 at 10 43 07 PM

Looking at the causes, I think it's mostly related to gradle-baseline's SafetyPropagationTransfer class

Screenshot 2024-11-04 at 10 43 34 PM
Screenshot 2024-11-04 at 10 43 29 PM
Screenshot 2024-11-04 at 10 41 13 PM

Specifically the getPath call on this line:

It seems like that call ends up throwing lots of Exceptions farther down in the com.sun.source code, and heavy use of Exceptions can cause slowness: https://shipilev.net/blog/2014/exceptional-performance/

What did you want to happen?

SafetyPropagationTransfer to run in a way where there aren't a lot of Java exceptions generated, so JFR doesn't show the "Thrown Errors" automated analysis result and ultimately gradle-baseline runs faster.

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

No branches or pull requests

1 participant