@ahopkins: when I pointed you towards AST, I already knew (from my benchmarks) that this could be an awesome feature for Sanic, not only because it would be pure Python (requiring no extra dependencies) but also would be in our reach to maintain.
@5onic I also like the trie
model, I just don’t know if having a pure Python (or regex mixed version) would be as fast as having code written on the fly. Moreover, perhaps we could try and mix trie
with the AST router and see if we can benefit from it - but this would make the router code pretty exclusive to maintain …
As of xrtr
, I’m playing a little bit (when possible) with pybind11, and I really believe an interesting router could be made using plain C++ with direct bindings to Python (instead of using Cython
), but, again, that would be a binary dependency for Sanic … Which I believe is a downside.