Don't run the "Date" header timer every second all the time #21850
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.
What does this PR do?
Only reschedule the Date header while there are in-flight incoming HTTP requests.
Update the Date header if, at the time we reschedule it, it is now stale.
Goal: don't wake up Bun's process on every second when we're idly doing nothing.
11.7% bad_speculation
36.0% frontend_bound 🔻
20.9% retiring
34.1% bad_speculation
41.9% retiring
0.0% backend_bound
24.0% frontend_bound 🔻
9.6% bad_speculation
56.2% frontend_bound
12.9% retiring
-20.0% bad_speculation
55.2% retiring
26.2% backend_bound
38.6% frontend_bound
How did you verify your code works?
Added a test