GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — [apex] New AvoidDebugStatements rule to mitigate performance impact by jonathanwiesel · Pull Request #3319 · pmd/pmd Conversation
Contributor
Describe the PRFlags usage of Related issuesReady?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Generated by 🚫 Danger |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like you have created this rule and the fix based on my tweet and gist https://gist.github.com/rsoesemann/8a612d9b28d9c572dfb203c9769a5809 Why did you remove the ignoring of explicit LoggingLevels? I think they often show that the developer knows what he does. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @rsoesemann, I didn't see your tweet or gist before, sorry if this looked like me trying to "rob" your implementation and applying it here, it was never my intention to claim authorship. Regarding what you mentioned about LoggingLevels, looking at the blog post mentioned in the issue it seems that even when no debug logs are being captured debug statement still do execute (but not written to a log), therefore the parsing and transformation of complex datatypes referenced in the debug statement could impact performance. Although it is true that the blog post only makes reference to simple
So implicitly there's a If you think this may not be deterministic, we could try replicating the same scenario mentioned in the blog post with explicit |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @jonathanwiesel I was happy to see you add this rule and have no issue with ownership. To be honest, for years I was the only guy creating rules and I am happy to see contributions. Follow me on Twitter @rsoesemann and you will understand. I see you point and trust Keirs measurements but I fear that many people will deactivate that rule because it will false-negative their important
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@rsoesemann I'm quite happy to contribute to the project, I've contributed a couple of times in the last few months and feels great, and I totally understand the feeling of being the only one caring for Apex 😉 (unfortunately my knowledge in PMD related development is scarce). I have no reasons not to trust Keirs research, is very valuable input from a reputable member of the community 🥇 I'm aware that people may want to deactivate the rule entirely because of false-negatives, but for such valid use cases that the debug statements are in fact necessary developers can use the suppression mechanism for those ( If we only had debug statements as a tool for debugging I would be inclined to be more permissive but since we have the Replay Debugger and Checkpoints (with their respective limitations of course) I feel like most of the use cases for debug statements could be managed using those other means instead of abusing on debug statements which has been demonstrated to impact performance even when not captured. What do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I'm no expert for Apex and I don't know all the options/alternative/state-of-the-art, so I leave the decision to you guys.
The rule as it is now, is very simple, so basically only little maintenance for the pmd project.
The issue itself #3307 received a couple of 👍, so it seems to scratch a real itch.
I see a couple of ways to go forward:
The other point
people may want to deactivate the rule entirely
They can only deactivate the rule, if they activated it before...
The question is more: should we add this new rule to the quickstart ruleset activated or just as a comment?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Andreas Dangel <[email protected]>
|
@adangel IMHO I would ship it like it is, although I have not been around as much as @rsoesemann and you 😉 so you probably know better than me what could be better for the community. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I am absolutely fine with your arguments @jonathanwiesel and shipping the rule as is. Even if I agree with @adangel proposal. Allowing LoggingLevel.ERROR would be better for me. But as it is an XPath rule it can be easily adjusted by anyone. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
[apex] New AvoidDebugStatements rule to mitigate performance impact #3319
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[apex] Avoid debug statements since it impact performance
There was an error while loading. Please reload this page.