GrammaTech / ddisasm

A fast and accurate disassembler
https://grammatech.github.io/ddisasm/
GNU Affero General Public License v3.0
646 stars 60 forks source link

optimize ram #72

Open gogo2464 opened 7 months ago

gogo2464 commented 7 months ago

In the future, could ddisasm require less ram please?

aeflores commented 6 months ago

This is something that we have considered internally a lot.

A big part of the memory consumption comes from doing superset disassembly at the beginning (decoding every possible offset in the code sections) and computing a lot of related information for all those instructions. Some of that "eager" computation could be done lazily by using functors more extensively, and that could result in significant memory savings, but that would likely make the code more complicated too.

I think we could achieve greater savings by doing changes in Souffle, the Datalog engine. Right now, Souffle data structures mainly prioritize performance and generality. We could probably keep performance and save space by giving away generality, i.e. having specialized data structures for the kind of relations needed for disassembly.