Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'maksym-queue-filtering-opt' into 'master'
perf: [EXC-1356] speed up execute_round by optimising queue::filter_messages Optimise `queue::filter_messages` for the case when number of dropped messages is small, less than a half of all the messages in the queue. Current approach iterates over all the messages in the queue and splits them into two buckets on the fly (filtered, not filtered), which essentially means every time reallocating the whole queue even when there are no changes in it. New approach first iterates over all the messages and collect indexes of dropped messages. If there's none, then stop early, without any extra memory allocations (presumably the most popular case). Otherwise split the initial queue into two buckets of a known size (which also saves some time on memory re-allocations). On a synthetic test with 20k total and 20 heartbeat canisters this optimisation showed -5...-8% of a total `execute_round` time. See merge request dfinity-lab/public/ic!11252
- Loading branch information