Performance issues
See original GitHub issueHi,
as we are stuck with Java 8 my team has found your project very interesting. We’ve already tried Jabel on local envs and results were very promising. Although Java 8+ features, debugging and stack traces were fine there’s an issue we face: performance.
Our project is a modular monolith. Complication time (pure javac) jumped from 3 minutes to about 40 minutes. We did instrumentation with JProfiler and although execution times are inflated than with regular sampling, but it’s all about the number of calls.
We think the source of the problem is in make()
method invocation.
visitors.forEach((className, visitor) -> {
byteBuddy
.redefine(
typePool.describe(className).resolve(),
classFileLocator
)
.visit(visitor)
.make()
.load(classLoader, ClassReloadingStrategy.fromInstalledAgent());
});
Do you have any tips to improve performance? We suspect that Jabel is also compiling third-party libraries of our project. Maybe there would be an option to add exclusions for such libraries? Or maybe the problem is in the byte-buddy library and library with better performance is worth considering? Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
No,
decorate
should allow exactly that. Decorate byte code but without resolving the hierarchy of super classes. I never heard of individual builds failing. I run Byte Buddy on adopt, there’s plenty of tests around this and they don’t fail. Is this still happening?Hierarchy resolution is expensive as it is complex. Since you are only decorating and not overriding methods, consider using decorate and not redefine snd use MethodGraph.Compiler.ForDeclaredMethods.INSTANCE in the ByteBuddy configuration.