Repository navigation
GC algorithm changes to reduce complexity and object allocation - #6636
Conversation
Assisted-By: OpenAI GPT-6 Luna
There was a problem hiding this comment.
Adding tests to ensure case is ignored is good.
| private boolean containsBulkPrefix(String path) { | ||
| int prefixLength = Constants.BULK_PREFIX.length(); | ||
| for (int i = 0; i <= path.length() - prefixLength; i++) { | ||
| if (path.regionMatches(true, i, Constants.BULK_PREFIX, 0, prefixLength)) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| } |
There was a problem hiding this comment.
This logic matches the original logic and looks like it should be faster using regionMatches and dropping streams.
ddanielr
left a comment
There was a problem hiding this comment.
The changes to the test code and blip prefix checks look good.
I'll need to step through the changes in makeRelative more closely but if the tests pass then it's most likely good.
| for (String delete : candidateMap.keySet()) { | ||
| String[] tokens = delete.split("/"); | ||
| if (tokens.length == 2) { | ||
| int firstSlash = delete.indexOf('/'); |
There was a problem hiding this comment.
This change should definitely reduce the number of string objects we were creating.
|
Full IT build succeeded |
DomGarguilo
left a comment
There was a problem hiding this comment.
LGTM. Didn't get my review in before merge. Going to put up a small PR to add a test case for makeRelative()
|
Made #6643 to add a test case while reviewing this PR. |
Assisted-By: OpenAI GPT-6 Luna