Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
`cidrtrie` is a dumb implementation of a prefix tree and a library for classifying IP addresses based on prefix matching. I know that there other implementations (like [py-radix](http://www.mindrot.org/projects/py-radix/)) that are faster or whatever, but this one is simple and pure-Python.

## Why? ##
`bench.py` contains a simple _O(n)_ implementation ("`NaiveCidrClassifier`)of this which I've seen in a few dozen projects (compared with the O(32) prefix tree). Some sample numbers for inserting 100,000 cidrs into the tree and then looking up 10,000 IPs:
`bench.py` contains a simple _O(n)_ implementation (`NaiveCidrClassifier`)of this which I've seen in a few dozen projects (compared with the O(32) prefix tree). Some sample numbers for inserting 100,000 cidrs into the tree and then looking up 10,000 IPs:

insert CidrClassifier 5.16s
insert NaiveCidrClassifier 0.11s
Expand Down