Skip to content

Replaced access path bases with access paths in backward dataflow #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MForest7
Copy link
Collaborator

@MForest7 MForest7 commented May 28, 2025

Replaced nested objects in backward dataflow with access paths, also get a performance increase.

project stmts avg time (main) avg time (new) aa improvement, % (old) aa improvement, % (new)
project1 9914 2.5s 1.6s 37.2 39.4
project2 26679 2.2s 1.4s 15.3 16.5
project3 4272 0.8s 0.4s 29.0 28.8
project4 4584 0.5s 0.3s 37.5 35.6
project5 121091 30.4s 9.3s 35.3 37.4
project6 28548 3.3s 1.7s 36.8 38.9
project7 5162 0.6s 0.4s 28.1 28.0

@MForest7 MForest7 requested a review from Lipen May 28, 2025 15:59
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@Lipen
Copy link
Member

Lipen commented May 30, 2025

What does the % mean in the table? Replace the table with fewer columns: project, size (stmts or similar), old time (avg +- sd), new time (avg +- sd). If the deviation is low (and it should be low, since the analysis should be near-deterministic), it can be omitted.

What about the "quality"? Comparing only the performance is not enough for such major change. Pick a metric (number of inferred types, ratio of all type, ratio of annotated type, number of inferred calls, etc) and add "old/new quality" columns.

@MForest7 MForest7 force-pushed the mforest/ets-access-paths-in-backward branch from 094d735 to 3f5fdde Compare June 24, 2025 10:57
doAddKnownTypes: Boolean = true,
) : Analyzer<BackwardTypeDomainFact, AnalyzerEvent, EtsMethod, EtsStmt> {

override val flowFunctions = BackwardFlowFunctions(graph, dominators, savedTypes, doAddKnownTypes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to keep savedTypes, or somehow justify its removal and clean up the forward flow functions accordingly.

val typeRefinement = typeRefinements[propertyPath]
val refinedType = if (type != null && typeRefinement != null) {
typeProcessor.intersect(typeRefinement, type)
} else type ?: typeRefinement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add { ... } braces to the else block.


refined
}
/*.mapValues { (_, typeFacts) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused code.

logger.warn { "Empty intersection type: ${acc.toStringLimited()} & ${typeFact.toStringLimited()}" }
acc
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants