Skip to content

Workflow compiler walks the whole physical plan to wire each link #9631

Description

@Matthew-DWM

Task Summary

To wire each logical link, WorkflowCompiler.expandLogicalPlan finds the upstream physical operator with physicalPlan.getPhysicalOpsOfLogicalOp(link.fromOpId).find(_.outputPorts.contains(link.fromPortId)) (WorkflowCompiler.scala#L290-L295). getPhysicalOpsOfLogicalOp builds a JGraphT DAG of the plan built so far and walks it in topological order. The plan is a new copy after every insertion, so each link rebuilds that DAG from scratch, and compile time grows with the square of the number of operators. The compiler runs on every edit in the workflow editor and again before each run.

On a warmed-up JVM (JDK 17), compiling a chain of 64 operators takes 10.8 ms, about 7 ms of which goes to these lookups. A workflow of 36 Aggregates spends about 5 ms of 9.8 ms in them.

Record the physical operator that produces each output port of each logical operator as operators are added, and wire links from that record. The compiled plan should not change.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on Nov 22, 2026
  2. Matthew-DWM commented on Nov 22, 2026

    @Matthew-DWM
    Author

    /take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions