This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Compare strings' hashes first before comparing their values.
ClosedPublic

Authored by jlebar on Oct 17 2016, 3:17 PM.

Details

Summary

We already have the hashes in hand, and comparing hashes should be much
more discriminatory than comparing the StringRefs' sizes.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 74919.Oct 17 2016, 3:17 PM
jlebar retitled this revision from to [ADT] Compare strings' hashes first before comparing their values..
jlebar updated this object.
jlebar added a reviewer: rafael.
jlebar added a subscriber: llvm-commits.
rafael accepted this revision.Oct 21 2016, 10:24 AM
rafael edited edge metadata.

LGTM. I was finally able to benchmark it. It had no significant impact one way or the other, probably because the tables in use are fairly large.

This might help in smaller tables where collisions are more likely.

This revision is now accepted and ready to land.Oct 21 2016, 10:24 AM

Thanks a lot for the review, Rafael.

This revision was automatically updated to reflect the committed changes.