mjschultz / py-radix

Python radix tree implementation for IPv4 and IPv6 prefix matching.
Other
121 stars 37 forks source link

feat(radix): Reduce memory footprint of the C implementation #51

Closed Darkheir closed 4 years ago

Darkheir commented 4 years ago

Try to reduce the memory foot print of the C implementation by:

To not break the prefixes() method the prefixes are now calculated from the packed value, the family and the prefix length on the fly.

I decided to keep family and prefixlen in the struct so we can recreate ranges from the python side:

"{}/{}".format(
    socket.inet_ntop(rnode.family, rnode.packed),
    rnode.prefixlen
)
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 90.33% when pulling 2a5666518653a96c2174660d27b88090cc9b60c2 on SEKOIA-IO:feat/reduce_memory_footprint into 52d70b050a1dcbf3a7849aa51b2420883e31539e on mjschultz:master.

Darkheir commented 4 years ago

My bad, this PR is breaking a lot of stuff and was not intended for the main repo.