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

Minimizing the cost of sentmap iteration #332

Open
kazuho opened this issue Apr 28, 2020 · 0 comments
Open

Minimizing the cost of sentmap iteration #332

kazuho opened this issue Apr 28, 2020 · 0 comments

Comments

@kazuho
Copy link
Member

kazuho commented Apr 28, 2020

As can be seen in #314 #329, the cost of skipping sentmap entries is a cost in ACK processing. At the moment, quicly iterates from the beginning of the sentmap twice per every ACK frame it receives, first when it processes the PNs being acked, then when it detects loss.

One way of moving forward is reducing the cost of iteration. #314 is an attempt that belongs to that category.

While that approach is fine by itself, I think we should consider how we can stop iterating through sentmap entries just to skip. And I think such an optimization would be possible.

We can assume that in almost all cases, the smallest PN carried by ACK frames would monotonically increase. We can depend on that and cache a tuple of (previous_smallest_pn, address_of_entry_corresponding_to_previous_smallest_pn). Then, we can almost always start iterating from that entry. Doing so entirely avoids the cost of skipping.

We could do the same for loss detection, by remembering the address of the sentmap entry corresponding to the smallest PN that is still considered inflight (or to the largest PN that has been deemed lost).

FWIW, when running PR #331 on a high-speed, low-latency, congested network, the CPU cost of quicly_sentmap_skip is 1.42% of the total.

Screen Shot 2020-04-28 at 1 32 29 PM

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

No branches or pull requests

1 participant