py-radix icon indicating copy to clipboard operation
py-radix copied to clipboard

slow and large memory taken for over 1M records

Open whille opened this issue 6 years ago • 1 comments

For over 1M records, like: "1.1.1.0/24 APNIC|APNIC||" , it takes minutes to initialize and > 1G memory. Any speed factors I neglected? Here's my test codes: https://github.com/whille/mylab/blob/master/qqzeng-ip-python/RadixSearch.py

whille avatar Jun 27 '18 11:06 whille

Do you know if you are using the python-only implementation or the c-based extension? The python-only implementation will be slower and much more memory intensive than the C version.

An alternative implementation is the network-finder utility that might work better for you is a binary search which should consume less memory but might be a bit slower (depending on how much less memory, it might be faster if page swapping is in play). It is designed to be API-compatible with this library, so it should be a simple swap in.

mjschultz avatar Jun 27 '18 15:06 mjschultz