Skip to content

Lower the default timeline window event budget to 400 - #5

Merged
Guitaraholic merged 1 commit into
mainfrom
fix/timeline-event-budget
Sep 2, 2026
Merged

Lower the default timeline window event budget to 400#5
Guitaraholic merged 1 commit into
mainfrom
fix/timeline-event-budget

Conversation

@Guitaraholic

@Guitaraholic Guitaraholic commented Sep 2, 2026

Copy link
Copy Markdown

Human comments

What was wrong

timelineWindowEventBudget defaulted to 1500, calibrated at ~0.06 ms/event so a cold build would stay near 100 ms. Measured p50 is 0.479 ms/event, so that same build is ~720 ms and blocks the serving loop. On a typical install the cap only bound for 2 of 76 threads; everyone else decoded the full event set on every maxSeq change.

Related: get-bb/bb#1749.

What changed

  • Default timelineWindowEventBudget is 400.
  • Override with BB_FF_TIMELINE_WINDOW_EVENT_BUDGET if you want the old window.
  • docs/configuration.md and the bb-guide customization template match.

No protocol change. Pagination still walks full history; head-state banners are not scanned from the window.

Why this way

get-bb#1749 lists three options: calibrate at startup, budget on decoded bytes, or lower the constant. Calibrating and byte-budgeting are new machinery. 400 is the value the issue already measured as a workaround: cold builds ~190 ms on a 4-core host, and the cap binds for 19 threads instead of 2.

Raising the env var restores the previous window. We did not add a startup benchmark or change the cache key (maxSeq still invalidates). Those are later cuts.

Benefit to bb

Every server, every thread that rebuilds a timeline window. Shorter stalls on the serving loop mean streams and other clients keep moving. Operators who need the old 1500-event window set the env var.

Harvest

Independent. Not yet opened on get-bb. Copy this body; Fixes get-bb#1749 if we want that linkage. Issue already proposed 400 as the workaround.

Decision record: docs/perf-control-plane.md (PR #9).

How you verified

  • packages/config/test/config.test.ts expects the new default and still honors an explicit env override. 53 passed.

Related: get-bb#1749

AGENT GENERATED

The 1500-event cap assumed 0.06 ms/event and almost never bound.
Measured p50 is 0.479 ms/event; 400 puts cold builds near 190 ms on
small hosts and makes the cap apply to more than two threads.

Override with BB_FF_TIMELINE_WINDOW_EVENT_BUDGET.

Related: get-bb#1749
@Guitaraholic
Guitaraholic merged commit 7735ea9 into main Sep 2, 2026
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.

timelineWindowEventBudget assumes 0.06ms/event; measured 0.479ms/event on a 4-core host

1 participant