Skip to content

docs(handoff): hand off the Bunnymark optimisation with a reproducible update-loop benchmark - #13

Closed
frostney wants to merge 1 commit into
mainfrom
perf/bunnymark-update-handoff
Closed

frostney wants to merge 1 commit into
mainfrom
perf/bunnymark-update-handoff

Conversation

@frostney

@frostney frostney commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Bunnymark's instanced path is bound by the JavaScript update loop, not by rendering: on a Radeon RX 6600M, 27.6 ms of a 28.2 ms frame at 10,000 sprites is updateBunnies. This records what was measured and what to do about it, so the optimisation can start in a fresh session. No example or binding code changes.

  • .agent/HANDOFF.md is rewritten as the handoff for that work: where the frame goes, the change to make in this repository, the opcode profile to take to GocciaScript, and what was not verified.
  • benchmarks/bunnymark-update-loop.ts times the update loop alone, with no window, raylib or capability, and compares the current loop with a candidate that must produce identical state.
GocciaRunner --ignore-config-permissions benchmarks/bunnymark-update-loop.ts

Ryzen 9 6900HX, GocciaScript 0.14.0, 10,000 sprites, three rounds of 100 frames:

Variant ms per frame
Current updateBunnies 28.13, 28.13, 28.09
Candidate: module constants in locals, bounds precomputed 20.49, 20.49, 20.51

The candidate is 27% faster with identical transforms, positions and velocities. It is not applied here; applying it and re-measuring across machines is the first step in the handoff.

The engine-side finding with the clearest evidence: a module-level const read inside a function compiles to OP_GET_GLOBAL, which costs about 125 ns here against about 20 ns for an arithmetic opcode.

…e update-loop benchmark

The instanced path is bound by the JavaScript update loop. The handoff records
where the frame goes, a candidate that removes 27% of the update time with
identical output, and the opcode profile to take to GocciaScript.
benchmarks/bunnymark-update-loop.ts reproduces the measurement without a
window or raylib.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: c4f8ee4b-90a0-456a-9096-38bb96aefb94

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2bd7e and 5490e2f.

📒 Files selected for processing (2)
  • .agent/HANDOFF.md
  • benchmarks/bunnymark-update-loop.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@frostney
frostney marked this pull request as ready for review October 1, 2026 15:20
@frostney

frostney commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Closing: this handoff should be a standalone markdown file, not a repository change.

@frostney frostney closed this Oct 1, 2026
@frostney
frostney deleted the perf/bunnymark-update-handoff branch October 1, 2026 15:27
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.

1 participant