Closed raabf closed 9 years ago
Since you maybe iterate over thousands of messages in a dump it is a good idea to add __slots__ for a better memory consumption and performance.
__slots__
It seems to save about 5 - 9% time:
/usr/bin/time python3 examples/print_all.py ~/Downloads/rib.20150101.0400.bz2 238.09user 63.81system 5:59.71elapsed 83%CPU (0avgtext+0avgdata 14236maxresident)k 64inputs+0outputs (0major+18652minor)pagefaults 0swaps
/usr/bin/time python3 examples/print_all.py ~/Downloads/rib.20150101.0400.bz2 220.48user 60.77system 5:37.79elapsed 83%CPU (0avgtext+0avgdata 14228maxresident)k 15056inputs+0outputs (16major+18640minor)pagefaults 0swaps
Sorry to keep you waiting... Thank you for your code. It was merged.
Since you maybe iterate over thousands of messages in a dump it is a good idea to add
__slots__
for a better memory consumption and performance.It seems to save about 5 - 9% time: