Open disconnect3d opened 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.
Maybe you want to give PyPy a try.
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
.
This is a summary of performance improvements that we can try in Manticore:
python -OO
and use type annotations instead and launch all tests with mypy (?)__slots__
especially for often/heavily accessed attributes__setstate__
and__getstate__
: don't call it if it is empty and use trivial data structures (tuples)Some other ideas, called by @pgoodman that I am not 100% sure about:
Inspired by https://github.com/trailofbits/manticore/issues/757