facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.89k stars 2.01k forks source link

[java] some simplifications and optimizations of the frontend #1681

Closed jeremydubreil closed 1 year ago

jeremydubreil commented 1 year ago

This pull requests simplifies the code of the Java frontend to make it more efficient when running the capture on JAR files. On the two benchmarks I looked at, running infer capture --generated-classes file.jar --sourcepath $PWD was 1.6X faster after these changes in the first case and 2.2X faster in the second case.

These optimizations includes:

These changes are mostly intended to reduce the memory allocations when running the frontend on a JAR file. The benefit should be lower when running the capture with Buck but I don't expect the frontend to become slower either.

facebook-github-bot commented 1 year ago

@davidpichardie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@jeremydubreil has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot commented 1 year ago

@jeremydubreil has updated the pull request. You must reimport the pull request before landing.

davidpichardie commented 1 year ago

Done! Merci beaucoup @jeremydubreil !