mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
### 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<br>11.7% bad_speculation<br>36.0% frontend_bound 🔻<br>20.9% retiring<br>34.1% bad_speculation<br>41.9% retiring<br>0.0% backend_bound<br>24.0% frontend_bound 🔻 | 21.3% backend_bound<br>9.6% bad_speculation<br>56.2% frontend_bound<br>12.9% retiring<br>-20.0% bad_speculation<br>55.2% retiring<br>26.2% backend_bound<br>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 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Bun's fork of uWebSockets
Bun's HTTP & WebSocket server is based on uWebSockets. Thanks to @uNetworkingAB for the great work!