-
Notifications
You must be signed in to change notification settings - Fork 919
Speeding up Truffle debugging #9142
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
base: master
Are you sure you want to change the base?
Conversation
|
wondering if there is a relation to #7663 |
…buildEngine before adding exit method breakpoint
|
commenting the also please note that none of the debugger tests ran so far, i added the labels which will enable them on next sync. would be also curious to find out why the debugger has to call into polyglot/GraalEngine code when the maven new-project wizard runs |
It's not specific to Maven. Same happens with other project types (eg. Ant and PHP). I'd initially thought something was triggered during cluster activation, but it's later during the new project creation. Seems to happen on first use of new project on subsequent runs too? |
interesting, didn't know that. I thought i tested the ant wizard as baseline and it worked fine, but it was a while ago by now.
at least in case of maven, second run within the same session is faster since there is quite some maven initialization going on during first run. #7590, however usually this is <2s and it happens before you can click next. First run performance while debugging is completely upredictable, the slowest run was 7mins, some were 40s. The issue has more info, bencharmks and flame graphs. |
a39d64a to
4bff9f1
Compare
| private static final String ENGINE_CLASS = "org.graalvm.polyglot.Engine"; // NOI18N | ||
| private static final String ENGINE_BUILDER_CLASS = "org.graalvm.polyglot.Engine$Builder"; // NOI18N | ||
| private static final String POLY_IMPL_CLASS = "com.oracle.truffle.polyglot.PolyglotImpl"; // NOI18N | ||
| private static final String POLY_IMPL_BUILD_METHOD = "buildEngine"; // NOI18N |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the big question to ask:
- can we rely on
com.oracle.truffle.polyglot.PolyglotImpl.buildEnginebeing there in subsequent releases of Truffle API? Engine.Builder.build()was an official API - it is not going to go awayPolyglotImpl.buildEngine(...)is just an implementation- but the speedup improvement is tempting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be an option, even though it's prone to break when the impl changes. I don't expect Truffle to change much these days, it's much more mature than it was during the engines and instrumentation development, which broke our Truffle debugger in the past. Even though we never know what happens to the private stuff.
I'll test the class loading order - maybe we could test if PolyglotImpl.buildEngine() is there and if yes then use it, if not then fall back to the public method.
LocalDateacross JVMs enso-org/enso#14632 I had to debug a lot