typetools / typetools/checker-framework

AnnotatedTypeMirrors of binary trees are recomputed too often

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

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:

  1. Cache the types. (Caches haven't worked well in the past)
  2. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.