Stream: git-wasmtime

Topic: wasmtime / PR #5131 Simplify overlap checking after remov...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2022 at 18:31):

jameysharp opened PR #5131 from overlap-cleanup to main:

Now that we aren't trying to do overlap checking in parallel, we can fuse the loop that generates a list of rule pairs with the loop that checks those pairs.

Removing the intermediate vector of pairs should save a little time and memory. But it also means we're no longer borrowing from the by_term HashMap, so we can use into_iter instead of values to move ownership out of the map. That in turn means that we can use into_iter on each vector of rules as well, which turns out to offer a slightly nicer idiom for looping over all pairs, and also means we drop allocations as soon as possible.

I also pushed grouping by priority earlier, so the O(n^2) all-pairs loop runs over smaller lists. If we later find we want to know about overlaps across different priorities, the definition of the map key is an easy place to make that change.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2022 at 18:31):

jameysharp requested elliottt for a review on PR #5131.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2022 at 19:01):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2022 at 19:08):

jameysharp has enabled auto merge for PR #5131.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2022 at 19:49):

jameysharp merged PR #5131.


Last updated: Dec 23 2024 at 13:07 UTC