[SERVER-70200] Implement UUID::Hash using bytes from UUID instead of murmur3 Created: 04/Oct/22  Updated: 29/Oct/23  Resolved: 15/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Henrik Edin Assignee: Damian Wasilewicz
Resolution: Fixed Votes: 0
Labels: neweng, techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution NAMER
Backwards Compatibility: Fully Compatible
Sprint: Execution NAMR Team 2023-09-04, Execution NAMR Team 2023-09-18
Participants:

 Description   

Since UUIDs are themselves randomly generated, one alternative to generating a hash for an UUID with a traditional hash algorithm is to take 4 bytes from the UUID itself and use that as the Hash. Care would be taken to avoid copying over the portions of the UUID that are deterministically set.



 Comments   
Comment by Githook User [ 15/Sep/23 ]

Author:

{'name': 'Damian Wasilewicz', 'email': 'damian.wasilewicz@mongodb.com', 'username': 'DamianWasilewicz'}

Message: SERVER-70200 Change UUID hash function to use bytes from UUID
Branch: master
https://github.com/mongodb/mongo/commit/4b1f548254331698222b77b9c80959cee8abd0bf

Comment by Damian Wasilewicz [ 07/Sep/23 ]

The original ticket was to change the UUID::Hash function from murmur to absl hash, but since most of the bytes in the UUID are themselves randomly generated, it might be faster to directly use a few of these bytes as the hash rather than running a hash algorithm.

Generated at Thu Feb 08 06:15:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.