Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Speed up item_bodies for large match statements involving regions #57494
These changes don't change anything about the complexity of the algorithms, but use some easy shortcuts or modifications to cut down some overhead.
The first change, which incrementally removes the constraints from the set we're iterating over probably introduces some overhead for small to medium sized constraint sets, but it's not big enough for me to observe it in any project I tested against (not that many though).
Though most other crates probably won't improve much at all, because huge matches aren't that common, the changes seemed simple enough for me to make them.
Click to expand the log.