Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache the set of active transfers in receive arbiter #319

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fknorr
Copy link
Contributor

@fknorr fknorr commented Dec 10, 2024

receive_arbiter tracks a transfer for every transfer id it learns through an inbound pilot, so long-running programs like wave_sim -T 10000 will fill the transfer map quickly. It's an unordered_map so lookups shouldn't suffer, but we iterate over it in poll_communicator, which has linear complexity (initially found by @psalz).

We only need to poll transfers for which we have already seen the receive_instruction. This PR avoids the linear growth by caching the set of active transfers in a vector, and iterating over that.

I've used the opportunity to refactor the code a bit and use std::erase_if in the many places we had erase-remove idiom before.

@fknorr fknorr requested review from psalz and PeterTh December 10, 2024 21:53
@fknorr fknorr self-assigned this Dec 10, 2024
Copy link

Check-perf-impact results: (000e2892abb21ddd1ae413a5c86d7d95)

❓ No new benchmark data submitted. ❓
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.

@coveralls
Copy link

coveralls commented Dec 10, 2024

Pull Request Test Coverage Report for Build 12304599460

Details

  • 41 of 42 (97.62%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 94.984%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/receive_arbiter.cc 38 39 97.44%
Files with Coverage Reduction New Missed Lines %
src/receive_arbiter.cc 3 96.09%
Totals Coverage Status
Change from base Build 12236072360: -0.03%
Covered Lines: 7090
Relevant Lines: 7202

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants