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

Slow java_package! with 200 classes #103

Open
1 of 2 tasks
fpoli opened this issue Jul 13, 2023 · 1 comment
Open
1 of 2 tasks

Slow java_package! with 200 classes #103

fpoli opened this issue Jul 13, 2023 · 1 comment

Comments

@fpoli
Copy link
Contributor

fpoli commented Jul 13, 2023

I noticed that when there are a lot of classes (>200 in my case) the java_package procedural macro takes several tens of seconds to run. I suspect that this is because for each class duchess spawns a new javap process, which in turns runs a full JVM.

  • Check if the bottleneck is really javap.
  • If the bottleneck is javap, it should be possible to keep reusing the same JVM by using the Java interface of javap.
@fpoli
Copy link
Contributor Author

fpoli commented Jul 13, 2023

The flamegraph of a cargo build confirms that 66% of the samples are in the JVM (start_thread). Within the JVM, 54% of the samples are in the Java compiler (CompileBroker::invoke_compiler_on_method).
image

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