Add indexed runtime identity path and hot-path benchmarks#1483
Merged
steve-the-edwards merged 7 commits intomainfrom Mar 12, 2026
Merged
Add indexed runtime identity path and hot-path benchmarks#1483steve-the-edwards merged 7 commits intomainfrom
steve-the-edwards merged 7 commits intomainfrom
Conversation
workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/ActiveStagingList.kt
Show resolved
Hide resolved
workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/ActiveStagingList.kt
Show resolved
Hide resolved
workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/SubtreeManager.kt
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Correction: completed a fresh local review pass of the PR diff (main...HEAD) and found no additional code changes needed. I updated the PR description to explicitly document RuntimeConfigOptions.INDEXED_ACTIVE_STAGING_LISTS as experimental, default-off, and the behavior when enabled, plus the latest validation commands. |
Amp-Thread-ID: https://ampcode.com/threads/T-019cde7c-dfc7-72bd-b224-6e8ec736e1db Co-authored-by: Amp <amp@ampcode.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Ai-assisted: true
Amp-Thread-ID: https://ampcode.com/threads/T-019cde7c-dfc7-72bd-b224-6e8ec736e1db Co-authored-by: Amp <amp@ampcode.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Ai-assisted: true
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com> Ai-assisted: true
4d7a76c to
65f0945
Compare
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pyricau
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimize the 'uniqueness' check that happens as we add nodes to the staging list - this happens on every render for every node. Currently we had to walk the linked list, but now we keep a set of identities for the nodes (the key set of a map) so we can check if it 'contains'. This is in addition to the actual
ActiveStagingListso we keep it as a LinkedList for the actual swaps.INDEXED_ACTIVE_STAGING_LISTSValidation
./gradlew :workflow-runtime:jvmTest --tests "*ActiveStagingListTest" --tests "*SubtreeManagerTest" --tests "*WorkflowNodeTest"./gradlew :benchmarks:runtime-microbenchmark:compileReleaseAndroidTestKotlin./gradlew :benchmarks:runtime-microbenchmark:connectedReleaseAndroidTest -Pandroidx.benchmark.dryRunMode.enable=trueANDROID_SERIAL=1C041FDF60017G ./gradlew :benchmarks:runtime-microbenchmark:connectedReleaseAndroidTest(Pixel 6 / Android 16, 56/56 tests passed)On-Device Benchmark Highlights (Median µs)
Device:
Pixel 6(oriole), Android16(SDK36).wideSiblingKeys_initialRenderAllChildrenwideSiblingKeys_rerenderSingleSiblingByPropsChangerememberManyEntries_sameInputsrememberManyEntries_changingInputsrememberManyEntries_mixedInputTypesstableHandlers_manyCallbacks_propChange