Skip to content
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

Create one Type object per type reference #1773

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

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Oct 2, 2024

Fixes #1768

Benchmark Results

Based on nova (without tests and without CDG/PDG)

Before:

Metric Value
Number of files translated 654
TranslationManager: Executing Language Frontend 67874 ms
PythonAddDeclarationsPass: Executing Pass 2788 ms
ImportResolver: Executing Pass 14048 ms
TypeResolver: Executing Pass 1810 ms
TypeHierarchyResolver: Executing Pass 781 ms
ResolveCallExpressionAmbiguityPass: Executing Pass 4605 ms
EvaluationOrderGraphPass: Executing Pass 1289 ms
SymbolResolver: Executing Pass 98916 ms
DFGPass: Executing Pass 1663 ms
ControlFlowSensitiveDFGPass: Executing Pass 15150 ms
DynamicInvokeResolver: Executing Pass 450 ms
FilenameMapper: Executing Pass 409 ms
TranslationManager: Translation into full graph 209793 ms

After:

Metric Value
Number of files translated 654
TranslationManager: Executing Language Frontend 82194 ms
PythonAddDeclarationsPass: Executing Pass 2967 ms
ImportResolver: Executing Pass 14717 ms
TypeResolver: Executing Pass 3225 ms
TypeHierarchyResolver: Executing Pass 299 ms
ResolveCallExpressionAmbiguityPass: Executing Pass 3410 ms
EvaluationOrderGraphPass: Executing Pass 1564 ms
SymbolResolver: Executing Pass 24892 ms
DFGPass: Executing Pass 1713 ms
ControlFlowSensitiveDFGPass: Executing Pass 15246 ms
DynamicInvokeResolver: Executing Pass 523 ms
FilenameMapper: Executing Pass 647 ms
TranslationManager: Translation into full graph 151411 ms

@oxisto oxisto linked an issue Oct 2, 2024 that may be closed by this pull request
@oxisto oxisto marked this pull request as draft October 3, 2024 08:48
@oxisto oxisto force-pushed the 1768-create-one-type-object-for-each-type-usage branch 2 times, most recently from 4f5828a to 64ba3ef Compare October 8, 2024 21:22
@oxisto oxisto marked this pull request as ready for review October 8, 2024 22:40
@maximiliankaul maximiliankaul marked this pull request as draft October 9, 2024 14:56
@oxisto oxisto force-pushed the 1768-create-one-type-object-for-each-type-usage branch from 38bb9d0 to 782689a Compare November 6, 2024 09:45
@oxisto oxisto force-pushed the 1768-create-one-type-object-for-each-type-usage branch from 782689a to c2002ef Compare November 15, 2024 12:30
@oxisto oxisto marked this pull request as ready for review November 18, 2024 15:09
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 76.66667% with 14 lines in your changes missing coverage. Please review.

Project coverage is 76.36%. Comparing base (897955d) to head (af6be91).

Files with missing lines Patch % Lines
...aisec/cpg/passes/inference/DFGFunctionSummaries.kt 69.04% 5 Missing and 8 partials ⚠️
...s/kotlin/de/fraunhofer/aisec/cpg/test/TestUtils.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...main/kotlin/de/fraunhofer/aisec/cpg/TypeManager.kt 83.33% <100.00%> (+0.47%) ⬆️
...otlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt 72.32% <ø> (ø)
...otlin/de/fraunhofer/aisec/cpg/graph/TypeBuilder.kt 57.50% <100.00%> (-7.21%) ⬇️
...ec/cpg/passes/JavaExternalTypeHierarchyResolver.kt 86.66% <100.00%> (+7.87%) ⬆️
...s/kotlin/de/fraunhofer/aisec/cpg/test/TestUtils.kt 71.27% <50.00%> (+0.75%) ⬆️
...aisec/cpg/passes/inference/DFGFunctionSummaries.kt 74.35% <69.04%> (+5.64%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@konradweiss konradweiss left a comment

Choose a reason for hiding this comment

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

I did not encounter any specific issues, however I would like to get the test coverage up if possible with meaningful tests. We should also look into how these changes impact performance

@oxisto oxisto force-pushed the 1768-create-one-type-object-for-each-type-usage branch from 80561a3 to 1daf06b Compare November 28, 2024 21:34
@oxisto
Copy link
Member Author

oxisto commented Nov 28, 2024

I did not encounter any specific issues, however I would like to get the test coverage up if possible with meaningful tests. We should also look into how these changes impact performance

The missing coverage is mostly due to the low coverage in the DFG function summaries, which I needed to change because of a rename and this drags into bad patch coverage :(

@oxisto
Copy link
Member Author

oxisto commented Nov 28, 2024

I did not encounter any specific issues, however I would like to get the test coverage up if possible with meaningful tests. We should also look into how these changes impact performance

It's faster. 150s vs 200s on the nova benchmark

@oxisto oxisto force-pushed the 1768-create-one-type-object-for-each-type-usage branch from 0543ec8 to af6be91 Compare November 29, 2024 21:54
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.

Create one Type object for each type usage
2 participants