-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: New core API #333
WIP: New core API #333
Conversation
Just briefly, the way you've implemented function in Similarly, with I also see no reason why liveness and other data flow analysis couldn't be completely generic, thus reusing all of that tested application logic, etc. It may be some extra work at the offset, but I think it is 100% worth it. And if we do come up with a nice generic function api, we can upstream it to the RRC Also, great work! ❤️ |
In the long run I plan to replace the old API completely, so I'm not sure wherever its worth it to implement the trait for it. Also I'm not 100% sure everything is right yet. For example in Falcon functions have a single exit node. This comes in handy at times, I just don't know yet if it's worth the extra complexity. |
So I'm pretty convinced generics are totally worth it here. For starters:
And a bunch of other reasons; besides not having to copy paste crap all over with minor tweaks, etc. E.g., the printer logic is basically unchanged, and the app logic is completely unchanged except for modification of the signature. Anyway, with very minimal effort, I got In that branch https://github.com/das-labor/panopticon/tree/m4b/generic_function can now compare more or less difference between the two implementations: e.g., on my machine:
For larger binaries, it's honestly astounding the performance speedup (and we haven't even started on easy gains like deduping strings across the program, etc.). Note it's not quite fair in the above, since
E.g., 1.7GB; but this is still 4.25x the size of the It gets even better, the larger the binary, the better the gains. Here is a larger binary with about 3k functions:
|
Well, I have good news and bad news; good news is the neo version definitely yields memory intensive savings, and also more good news is that petgraph is a really great library. the "bad news" is i ported function to use petgraph, and re-ran benchmarks, and basically the old function is actually faster than neo (but as expected, uses less memory). Here are a couple tables I created to illustrate this: libc, 2999 functions:
rust binary, 2843 (long) functions:
What this indicates to me is that our graph lib was a significant bottleneck, and its good we switched, but some of the CPU savings that the neo version brings are actually misleading, since most of it comes from petgraph... |
This is still on personal branch FYI |
Panopticon is (still) slow and has an awkward API. This PR implements the changes suggested in #308 in response to #313.
RREIL code is encoded to save space and cut down on allocations. Also. mnemonics and basic blocks can be iterated w/o traversing the cfg. The new disassembly code is ~2 times faster (2.7s vs. 4.3s for a static Hello World).
This PR adds a new crate with (micro) benchmarks to track performance improvements over the old code.