Skip to content

Implement result caching with dirty propagation #14

Description

@Konstantysz

Problem

Changing a single parameter (e.g., threshold value) re-executes the entire graph, including unchanged upstream nodes. This is wasteful for 10+ node pipelines.

Proposal

Cache node outputs and only re-execute dirty nodes.

Design

  • Add Node::m_isDirty flag and Node::MarkDirty()
  • Propagate dirty flag downstream when:
    • Node parameter changes
    • Input connection changes
    • Upstream node is marked dirty
  • Cache last output in Node::m_cachedOutput
  • Skip Process() if !m_isDirty and cache exists

Memory Management

Add cache size limit (e.g., 500MB), LRU eviction.

Acceptance Criteria

  • Graph with 10 nodes: changing last node param only re-executes last node
  • Cache invalidates correctly when connections change
  • Memory usage stays below limit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions