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 — [core] CPD: Optimize --skip-lexical-errors option by woongsikchoi · Pull Request #3385 · pmd/pmd Conversation
Contributor
Describe the PRThis PR optimizes the state saving mechanism for --skip-lexical-errors option:
I did some benchmarking and it shows that the performance gain is substantial for large projects:
Ready?
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.
|
This looks great. I'd probably review the semantics, but certainly a valid approach and as shown, the reduced allocations should greatly improve the performance. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the contribution, this will be part of the following release. |
Sorry, something went wrong.
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.
| private int tokensMapSize; | ||
|
|
||
| public State(List<TokenEntry> entries) { | ||
| public State() { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@jsotuyod I wonder, how strict we should see compatibility here. Technically this changes TokenEntry.State, which is not internal, but public API and could potentially be used by someone...
Should we simply re-add these old constructor and method as deprecated?
I had a short look at CPD, and the TokenEntry class is part of the public API when retrieving the results of CPD (via Match -> Mark -> TokenEntry). So we can't simply internalize the whole TokenEntry class...
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.
good point. Yeah, that should work
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.
Probably, TokenEntry.State should be internal and deprecated
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[core] CPD should avoid unnecessary copies when running with --skip-lexical-errors
There was an error while loading. Please reload this page.