draperlaboratory / cbat_tools

Program analysis tools developed at Draper on the CBAT project.
MIT License
102 stars 14 forks source link

Create a program cache #250

Closed fortunac closed 4 years ago

fortunac commented 4 years ago

Based off the discussion from #248.

That PR broke the inner consistency of the knowledge base, something we should avoid. There were multiple solutions such as creating a custom loader to read our custom Project.t representation, saving one subroutine per file, or creating a cache for the Program.t

While having one subroutine per file sounds like a good idea to minimize the BAP startup overhead and the weakest precondition is only being calculated on one subroutine at a time, WP still looks at the other functions to create function summaries. We also want to avoid serializing our project to keep our CLI cleaner. Creating a program cache also required the least amount of changes to WP.

The speed of this is similar to the previous PR (e.g. tar_dirname: 8.645s and parse_branch: 2m46.430s.)

philzook58 commented 4 years ago

Looks good! I hope this puts us in compliance with proper use of the knowledge base.