Page MenuHomePhabricator

Avoid calculating the string hash twice in GsymCreator::insertString.
ClosedPublic

Authored by simon.giesecke on May 14 2021, 5:16 AM.

Details

Summary

Do the single hash calculation before acquiring the lock, to reduce
lock contention. If Copy is true, and the string was not yet contained
in the StringStorage, use the new address from StringStorage, but
reuse the hash we already calculated.

Diff Detail

Event Timeline

simon.giesecke created this revision.May 14 2021, 5:16 AM
simon.giesecke requested review of this revision.May 14 2021, 5:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2021, 5:16 AM
clayborg accepted this revision.May 14 2021, 2:56 PM
This revision is now accepted and ready to land.May 14 2021, 2:56 PM
simon.giesecke edited the summary of this revision. (Show Details)

I moved the hash calculation out of the lock now, as suggested in D102486.

clayborg accepted this revision.May 17 2021, 10:59 PM

Update using arc