This is an archive of the discontinued LLVM Phabricator instance.

Remove GnuHashTableSection::getShift2().
ClosedPublic

Authored by ruiu on Mar 15 2018, 4:12 PM.

Details

Summary

Choosing a Shift2 value based on wordsize is cargo-culted from gold.
Assuming that djb hash is a good hash function, choosing bits [4,9]
shouldn't be any worse or better than choosing bits [5,10]. We shouldn't
have copied that behavior that we can't justify in the first place.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

ruiu created this revision.Mar 15 2018, 4:12 PM
grimar accepted this revision.Mar 16 2018, 2:15 AM

LGTM.
(Though I think we could change it to 12+. We can't justify at this moment why it shows better results,
but it shows them whatever the real reason is. And that value at least would be based on observations.
I think technically setting is to 6 is at the same level of cargo-culting while we are unable to explain why
values ~12+ are faster).

This revision is now accepted and ready to land.Mar 16 2018, 2:15 AM
ruiu added a comment.Mar 19 2018, 4:06 PM

I don't want to change a value based on an observation that in some condition some number showed a better result. We don't know if that's an artifact of the test environment, and we don't know why these numbers are different in the first place.

This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.