This is an archive of the discontinued LLVM Phabricator instance.

[pseudo] Invert rows/columns of LRTable storage for speedup. NFC
ClosedPublic

Authored by sammccall on Jun 3 2022, 2:52 PM.

Details

Summary

There are more states than symbols.
This means first partioning the action list by state leaves us with a smaller
range to binary search over. This improves find() a lot and glrParse() by 7%.
The tradeoff is storing more smaller ranges increases the size of the offsets
array, overall grammar memory is +1% (337->340KB).

Before:
glrParse 188795975 ns 188778003 ns 77 bytes_per_second=1.98068M/s
After:
glrParse 175936203 ns 175916873 ns 81 bytes_per_second=2.12548M/s

Diff Detail

Event Timeline

sammccall created this revision.Jun 3 2022, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 2:52 PM
sammccall requested review of this revision.Jun 3 2022, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 2:52 PM
hokein accepted this revision.Jun 7 2022, 12:26 AM

oh, this looks nice, and makes the code simplier.

This revision is now accepted and ready to land.Jun 7 2022, 12:26 AM
This revision was landed with ongoing or failed builds.Jun 8 2022, 2:35 PM
This revision was automatically updated to reflect the committed changes.