Skip to content

Comments

Add deeper tree shapes to runtime microbenchmarks#1471

Open
zach-klippenstein wants to merge 3 commits intomainfrom
zachklipp/deep-benchmarks
Open

Add deeper tree shapes to runtime microbenchmarks#1471
zach-klippenstein wants to merge 3 commits intomainfrom
zachklipp/deep-benchmarks

Conversation

@zach-klippenstein
Copy link
Collaborator

@zach-klippenstein zach-klippenstein commented Feb 20, 2026

Summary

  • Renamed ComposeRuntimeMicrobenchmark to WorkflowRuntimeMicrobenchmark to accurately reflect what's being benchmarked
  • Added a SquareishTree shape (degree=3, depth=5, 243 leaves) alongside the existing ShallowBushyTree (degree=75, depth=1, 75 leaves) to better approximate real-world workflow trees
  • Added extra work (side effects, remember calls) in intermediate and leaf workflows to more closely emulate real-world usage

Note: The two commits should be reviewed separately.

Here's an example run of the benchmarks on a Samsung phone (results parsed and formatted by Claude, but I spot-checked to numbers to confirm it's not hallucinating):

ShallowBushyTree (degree=75, depth=1, 75 leaves)

Benchmark NoOptimizations AllOptimizations
initialRenderAllChildren 1.49 ms 1.55 ms
initialRenderNewSibling 453.0 us 369.9 us
tearDownAllChildren 1.27 ms 1.38 ms
tearDownSingleSibling 464.7 us 379.8 us
rerenderAllChildrenByPropsChange 400.3 us 409.3 us
rerenderSingleSiblingByPropsChange 390.0 us 327.4 us
rerenderAllChildrenViaStateChange 25.34 ms 539.2 us (47x)
rerenderSingleSiblingViaStateChange 395.9 us 336.9 us

SquareishTree (degree=3, depth=5, 243 leaves)

Benchmark NoOptimizations AllOptimizations
initialRenderAllChildren 5.48 ms 5.83 ms
initialRenderNewSibling 1.67 ms 1.36 ms
tearDownAllChildren 5.50 ms 5.60 ms
tearDownSingleSibling 1.69 ms 1.38 ms
rerenderAllChildrenByPropsChange 1.54 ms 1.54 ms
rerenderSingleSiblingByPropsChange 1.56 ms 1.31 ms
rerenderAllChildrenViaStateChange 272.65 ms 4.05 ms (67x)
rerenderSingleSiblingViaStateChange 1.81 ms 1.05 ms

Test plan

  • Ran all 32 benchmarks on a physical device (SM-A256U1, Android 16) — all passed
  • Verified benchmark results are reasonable and consistent across runs

🤖 Generated with Claude Code

…eal-world.

Also added some work to the workflows to also emulate IRL workflows better.

Benchmarks are now showing significant improvement with all optimizations
enabled.
@zach-klippenstein zach-klippenstein requested a review from a team as a code owner February 20, 2026 22:22
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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