Skip to content

Conversation

@Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Aug 14, 2025

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.

Metric this branch main
task-clock 35.24 msec 🟢 102.79 msec
context-switches 619 🟢 1,699
cpu-migrations 11 🟢 35
page-faults 2,173 2,174
cpu_atom/instructions 109,904,685 (1.76 insn/cycle) 🟢 67,880,002 (0.55 insn/cycle)
cpu_core/instructions 87,183,124 (1.07 insn/cycle) 🟢 32,939,500 (0.44 insn/cycle)
cpu_atom/cycles 62,527,125 (1.774 GHz) 🔻 122,448,620 (1.191 GHz)
cpu_core/cycles 81,651,366 (2.317 GHz) 🟢 75,584,111 (0.735 GHz)
cpu_atom/branches 9,632,460 (273.338 M/sec) 🔻 12,119,616 (117.909 M/sec)
cpu_core/branches 17,417,756 (494.259 M/sec) 🟢 6,901,859 (67.147 M/sec)
cpu_atom/branch-misses 192,013 (1.99%) 🟢 1,735,446 (14.32%)
cpu_core/branch-misses 473,567 (2.72%) 🟢 499,907 (7.24%)
TopdownL1 (cpu_core) 31.4% backend_bound
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 🔻
21.3% backend_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
time elapsed 1000.0219 s 1000.0107 s
user time 0.042667 s
sys time 0.060309 s

How did you verify your code works?

Added a test

@robobun
Copy link
Collaborator

robobun commented Aug 14, 2025

Updated 2:36 AM PT - Aug 14th, 2025

@autofix-ci[bot], your commit 43d4ccd has 6 failures in Build #22923:


🧪   To try this PR locally:

bunx bun-pr 21850

That installs a local version of the PR into your bun-21850 executable, so you can run:

bun-21850 --bun

@Jarred-Sumner Jarred-Sumner merged commit 7b31393 into main Aug 14, 2025
59 of 62 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/date-header branch August 14, 2025 22:39
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.

4 participants