A high performance HTTP request router using Radix Tree inspired by httprouter
- Using binary search to find child to avoid worst O(n)
- More detailed conflict information
Match path /user/:name/:sex/:age Ten Million times:
- Golang implementation cost about 2.7 seconds
- C++ implementation cost about 3.7 seconds
- Python implementation cost
- CPython about 60 seconds
- PyPy about 3.7 seconds
See router/tree/tree.go, router/tree/test_tree.cc and router/tree/test_tree.py for more details.
Unlike Golang, the Python builtin libs have poor suport for http-server side. So you have to inherit router.BaseRouter for you own.
example/ contains several server-side simple examples.
The MIT License.