-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[core] Micro optimizations for Node API #4353
Conversation
Generated by 🚫 Danger |
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeRule.java
Outdated
Show resolved
Hide resolved
I'm curious about the workload against which you got this rule to be "the slowest by very far". Don't get me wrong, it's certainly among the slowest, but when I ran PMD 7 against it's own sources, there were 8 rules even slower than that one:
|
I've got this on openjdk 11 sources of java.base
Interestingly I ran on pmd sources like you and there AddEmptyString was rank 13 so not sticking out. Maybe the jdk sources have some pathological files... |
Thanks! Very interesting to see how PMD performs differently under different workloads. |
Describe the PR
Mostly just make some methods of AbstractNode final so that they are easier to inline. Remove the overrides of AbstractNode::getChild, which are only seldom useful but makes the call sites in eg the implementations of NodeStream megamorphic for nothing. I found it might make a small performance difference while profiling.
Also convert AddEmptyString to a java rule because that's the slowest rule in pmd-java by very far.
I don't intend this to be groundbreaking but it should certainly be a nice to have.
Ready?
./mvnw clean verify
passes (checked automatically by github actions)