forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optimization] do not store empty objects in the knowledge base (Bina…
…ryAnalysisPlatform#1411) Improves the performance by not storing the empty objects (objects without values) in the knowledge base. When an object is created, we just increase the id of the last created object instead of storing it in the heap of objects. This improves performance and memory footprint and creating a new object doesn't require any more memory in the knowledge base. As a side effect, the object identifiers are never reused, therefore there's no possiblility for unwanted aliasing. It will also make much easier to implement KB garbage collector or tree shaker if we will even need them. The optmization gets about 10% improvement in both memory and time consumption, and overall performance improvement since 2.4.0 is about 50%. The knowledge base canonical representation is changed but in a backward compatible manner, so that the old knowledge bases should be read correctly and will be updated, if necessary in the new format. This performance optimization is a tradeof between expending the object space and overall performance of BAP. At the cost of using more object identifiers (and we have plenty of them in the 2^60 space so that we will run out of the space, both RAM or HDD long before we will run out of the identifiers). The story might look different in the OCaml 32-bit word, though.
- Loading branch information
Showing
2 changed files
with
55 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters