Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
mesa
mesa
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,321
    • Issues 2,321
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 634
    • Merge Requests 634
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Mesa
  • mesamesa
  • Merge Requests
  • !3475

Merged
Opened Jan 20, 2020 by Anthony Pesch@apeschContributor

util/hash_table: replace _mesa_hash_data's fnv1a hash function with xxhash

  • Overview 11
  • Commits 5
  • Pipelines 10
  • Changes 30

This is a MR for the issue discussed in #2153 (closed).

The original patch in the issue only swapped in xxhash for the v3d driver's hash table usage, but this MR (as per the bug discussion) makes it the default for _mesa_hash_data itself.

I broke this into a few commits as I wasn't sure how much change was wanted:

  • First commit adds the xxhash dependency.
  • (optional) Second commit moves fnv1a routine into its own header. Now that fnv1a isn't the only hash function used by hash_table.c, I tossed it into its own header like xxhash.
  • Third commit finally replaces the fnv1a usage in _mesa_hash_data with xxhash.
  • (optional) Fourth commit adds int / unsigned int / uint32 hash functions which use an inlined version of XXH32 that's optimized for the key size.
  • (optional) Fifth commit replaces uses of _mesa_hash_data for integers with the new optimized routines.

The last two commits came because I was concerned about regressing performance for users now hashing small keys with xxhash (which is known to be slightly slower in this case). After inlining XXH32 with the constant key size I believe the difference should be marginal outside of a benchmark.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: mesa/mesa!3475
Source branch: xxhash