Skip to content

WIP testing performance#1898

Draft
Mbeaulne wants to merge 1 commit intomasterfrom
03-04-wip_testing_performance
Draft

WIP testing performance#1898
Mbeaulne wants to merge 1 commit intomasterfrom
03-04-wip_testing_performance

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 4, 2026

Description

This pull request introduces a Zustand-based state management system for component specifications to improve performance and enable granular updates. The implementation adds a new store that decomposes ComponentSpec objects into normalized graph levels, allowing individual task properties (arguments, annotations, execution options) to be updated without triggering re-renders of unrelated components.

Key changes include:

  • Added Zustand dependency (^5.0.11) for state management
  • Created componentSpecStore with decompose/compile logic for ComponentSpec normalization
  • Implemented granular selectors that only re-render when specific data changes
  • Added bridge layer to sync between existing ComponentSpecProvider and new store
  • Updated TaskNodeProvider to read from store for stable per-task references
  • Modified FlowCanvas to use structural fingerprints for optimized React Flow node recreation
  • Enhanced argument and annotation editors to use direct store mutations

Type of Change

  • New feature
  • Improvement
  • Cleanup/Refactor

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Load a pipeline with multiple tasks and nested subgraphs
  2. Edit task arguments and verify only the edited task re-renders
  3. Navigate between subgraphs and confirm performance improvements
  4. Test bulk operations like node duplication and replacement
  5. Verify display name editing works without full component re-renders
  6. Confirm React Flow canvas only recreates nodes when structure changes (add/remove tasks, position changes)

Additional Comments

This is Phase 2 of the Component Spec Optimization Milestone (CSOM). The implementation maintains backward compatibility through a bridge layer while introducing performance optimizations. The store uses referential stability to ensure unchanged tasks maintain the same object references, preventing unnecessary re-renders in React components.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=03-04-wip_testing_performance/903f4ec`

Copy link
Collaborator Author

Mbeaulne commented Mar 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Mbeaulne Mbeaulne force-pushed the 03-04-wip_testing_performance branch 2 times, most recently from 98bef3d to e2864b2 Compare March 4, 2026 23:49
@Mbeaulne Mbeaulne force-pushed the 03-04-wip_testing_performance branch from e2864b2 to 903f4ec Compare March 4, 2026 23:58
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