Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[memprof] Use BLAKE for FrameId (llvm#109501)
This patch uses a stronger hash function for FrameId. Without this patch, I've observed hash collisions in fairly common scenarios. Specifically, for a given GUID, I see three pairs of hash collisions in the two-dimensional range 1 <= LineOffset <= 70 and 1 <= Column <= 50, which may be a bit too frequent. With the new function, I don't see collisions at all even for a large profile. Impact on serialization/deserialization should be as follows: - Up to indexed memprof format Version 2, inclusive: The FrameIds computed with the new hash function will show up as part of the profile file. However, the deserializer only treats FrameIds as keys (but not hash values) to retrieve Frames from the on-disk hash table, so a change of the hash function shouldn't matter. - For indexed memprof format Version 3, FrameIds do not show up at all in the resulting profile file. FrameIds are only used to break ties when we sort Frames in writeMemProfFrameArray.
- Loading branch information