Skip to content

Best Practices to help the static analysis when generating native images? #5718

Answered by cstancu
Jiehong asked this question in General
Discussion options

You must be logged in to vote

Hi @Jiehong, how the code is organized shouldn't make much difference on analysis/compilation performance. From the point of view of the analysis what matters is if it can prove that some execution paths can never be taken, e.g., if it can prove that a variable x always has type A then the else branch of a if(x instanceof A) can be eliminated. The analysis consumes the code one method at a time, regardless of how the code is divided in files, but organizing the code in type hierarchies may give more type hints and enable more aggressive optimizations. Generated code doesn't hurt the analysis as long as the generated code is not unnecessarily large when compared to the manually written equ…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by cstancu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants