Skip to content
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

Optimize Eq and Hash for Path/PathBuf #90596

Merged
merged 5 commits into from
Nov 14, 2021
Merged

Commits on Nov 9, 2021

  1. add benchmarks and tests for Hash and Eq impls on Path

    The tests check for consistency between Ord, Eq and Hash
    the8472 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    82b4544 View commit details
    Browse the repository at this point in the history
  2. optimize Hash for Path

    Hashing does not have to use the whole Components parsing machinery because we only need it to match the
    normalizations that Components does.
    
    * stripping redundant separators -> skipping separators
    * stripping redundant '.' directories -> skipping '.' following after a separator
    
    That's all it takes.
    
    And instead of hashing individual slices for each component we feed the bytes directly into the hasher which avoids
    hashing the length of each component in addition to its contents.
    the8472 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    a083dd6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f6e080 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a6e0aa2 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2021

  1. Prefix can be case-insensitive, delegate to its Hash impl instead o…

    …f trying to hash the raw bytes
    
    This should have 0 performance overhead on unix since Prefix is always None.
    the8472 committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    c1ea7bd View commit details
    Browse the repository at this point in the history