Avoid redundant path obfuscation hash stretching - #116
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove ineffective path-obfuscation hash stretching so full Metadata identity scans retain the same document IDs without delaying plug-in start-up.
Summary
Rationale
Metadata identity validation now derives the expected document ID for every normal-file Metadata entry before Offline Scanner mutation. This exposed a legacy loop in path obfuscation which repeated SHA-256 according to the input length.
Every iteration hashed the original buffer again rather than chaining the previous digest. It therefore produced the same document ID as one digest while adding substantial work. On the local benchmark used for this change, collecting 4,000 consistent Metadata entries with path obfuscation fell from about 13.8 seconds to about 0.29 seconds. Absolute timing is host-dependent.
The path-obfuscation output and stored document IDs remain unchanged.
Verification