openrewrite / openrewrite/rewrite-analysis

Global Data Flow: Optimize `FlowGraph` Creation

Open
#21 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature: Global Data Flow
Dominant language
Java
Stars
16
Forks
12
Avg merge
2h 26m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where FlowGraph instances are created from DataFlowNode objects and where data flow computation proceeds. Trace the existing computation and tests, if present, then verify that repeated nodes reuse a graph and that computation can stop when a cached graph is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.