typetools / typetools/checker-framework
AnnotatedTypeMirrors of binary trees are recomputed too often
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Types of binary trees are recomputed each time getAnnotatedType is called. The type of a binary tree is the LUB of the left and right side of the trees, so getAnnotatedType is called on the left and right trees. Data flow calls getAnnotatedType on every node in a binary tree.
Possible fixes:
- Cache the types. (Caches haven't worked well in the past)
- Compute the LUB in dataflow which will store the types. (Any checker that wants the type to be something other than the LUB will have to override CFTransfer.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing getAnnotatedType calls through data flow and the binary-tree type computation. Compare caching with computing the LUB in dataflow, then define done as avoiding repeated recomputation while preserving checker-specific type behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100