Repository navigation
Conversation
The timeout splay tree stores its keys as offsets from a fixed epoch. Dropping the epoch's microseconds shifts every offset by the same constant, which cancels when calculating timeout deltas. Store only the epoch's seconds and reconstruct a zero-microsecond curltime for offset calculations. This reduces Curl_timeouts and Curl_multi by eight bytes on 64-bit builds without changing timeout ordering or durations. Closes #22806
cmeister2
force-pushed
the
cm2/multi-timeout-base-seconds
branch
from
September 2, 2026 16:51
258de9c to
34a4713
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The whole-second conversion needs focused regression coverage using a nonzero-microsecond epoch.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Stores timeout epochs at whole-second precision to reduce Curl_multi memory usage without changing timeout ordering or durations.
Changes:
- Replaces the full
curltimeepoch withtime_t. - Reconstructs a zero-microsecond epoch for offset calculations.
File summaries
| File | Description |
|---|---|
lib/splay.h |
Shrinks the timeout epoch field. |
lib/splay.c |
Stores seconds and reconstructs the epoch. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Verify that a base with nonzero microseconds shifts deadline and current time offsets equally and preserves the calculated timeout.
bagder
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The timeout splay tree stores its keys as offsets from a fixed epoch. Dropping the epoch's microseconds shifts every offset by the same constant, which cancels when calculating timeout deltas.
Writing the reconstructed whole-second epoch as
base', the remaining timeout is unchanged:Every deadline offset is also shifted by the same constant, so their ordering is preserved.
Store only the epoch's seconds and reconstruct a zero-microsecond curltime for offset calculations. This reduces Curl_timeouts and Curl_multi by eight bytes on 64-bit builds without changing timeout ordering or durations.