-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix #3648 added Ability to set DebugProbes.enableCreationStackTraces using system property #3764
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
Closed
PavlovIvan
wants to merge
1
commit into
Kotlin:develop
from
PavlovIvan:fix-set-enableCreationStackTraces-via-sys-props
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@dkhalanskyjb WDYT about adding system property only for the
enableCreationStackTraces
here with an extra comment?My initial line of thought was that creation stacktraces are the only imporant/performance-sensitive part that folks who run agent externally might want to disable explicitly via system property.
Yet indeed it makes sense to work both ways
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.
I don't understand the alternative you're implying here. Do you propose adding a system property to
sanitizeStackTraces
as well? If so, here are my preferences, from most desirable to least desirable:DebugProbes.install
, I don't see at all why it's a big deal also to writeenableCreationStackTraces = false
. When used as an agent, there are no other sensible entry points where this parameter can be placed, so a system property makes sense, but here, when you haveDebugProbes.install
anyway? Either I'm missing something, or this is code golfing, and the cost is that the way you run your code may start affecting what happens in non-obvious ways.enable.creation.stack.trace
. Even if, for some reason, we have to add it, it's an unpleasant workaround around some issue that I don't understand, not a valid API entry point.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.
You got it indeed; I was unsure about the change (it seemed rather ad-hoc), and the rationale "We prefer system properties over programmatic API" was not sufficient to me, wanted to have a second opionion
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.
In our classloader, that can return a correct class implementation. That's why we cannot call
enableCreationStackTraces = false
.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.
What is a "correct class implementation"? Also,
install
doesn't return anything.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.
For what I need — to get rid of byte-buddy and avoid performance regression https://youtrack.jetbrains.com/issue/IDEA-313677/Performance-degradation-in-findUsages-localInspections-and-completion
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.
Is
consumeClassData
something you use to emulate the effect ofinstall()
? If so, is it impossible to callenableCreationStackTraces = false
before returning the result?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.
No. To call it, we have to load (
defineClass
) some class from coroutine lib, and we cannot do it. That's why I ask system property.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.
I've reopened #3648
to continue the discussion and/or explain why it's important. The original report hasn't stated all the intentions and limitations, thus was hard to reason about