trailofbits / manticore

Symbolic execution tool
https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/
GNU Affero General Public License v3.0
3.68k stars 472 forks source link

Improve performance #1336

Open disconnect3d opened 5 years ago

disconnect3d commented 5 years ago

This is a summary of performance improvements that we can try in Manticore:

Some other ideas, called by @pgoodman that I am not 100% sure about:

Inspired by https://github.com/trailofbits/manticore/issues/757

feliam commented 5 years ago

Also. CoW and persisten object ID (for say pickle) will most likely dominate any other speed improvement trick in big/long runs. My bet is that currently the object copying/duplication and serialization is the bigger cause for slows there. Next in line is solver query no-optimization. Distant next is not lazy event system.

Any performance improvement trick that kill versatility will work against these more important things and should be approached carefully.

ltfish commented 5 years ago

Maybe you want to give PyPy a try.

pgoodman commented 5 years ago

Another low-hanging fruit optimization to try is to use a "magic" constant value for byte values in memory. Then, for all reads/writes, you opportunistically read the byte's present value, and if it matches the magic value, then you know that the value for that byte's concrete address is backed by the symbolic store. If a bytearray is used, then your magic value can be chosen by doing some profiling to find of distributions of byte values in memory for some runs, and then you still need a slow-path check to double-check if something is symbolically backed. If your memory is just a list of ints, then you can use a value like 257.