openrewrite / rewrite-analysis

OpenRewrite recipes for data flow analysis.
Apache License 2.0
8 stars 8 forks source link

Global Data Flow: Optimize `FlowGraph` Creation #21

Open JLLeitschuh opened 1 year ago

JLLeitschuh commented 1 year ago

Currently, we are redundantly creating multiple FlowGraph for paths that we've already previously computed. We could optimize this by having a cache of DataFlowNode to FlowGraph, such that when we attempt to create a FlowGraph for an existing DataFlowNode, we return the existing FlowGraph.

This could likely further be optimized if, while performing the data flow computation, we received a cached FlowGraph could stop the computation preemptively.

joanvr commented 1 year ago

Thank you for your suggestion. Would you like this to be assigned to you? :)