lua-radix-router
lua-radix-router copied to clipboard
perf: try to remove the trie metatable
Summary:
Try to remove the metatable.
before removed:
RADIX_ROUTER_ROUTES=100000 RADIX_ROUTER_TIMES=10000000 luajit benchmark/simple-variable.lua
========== variable ==========
routes : 100000
times : 10000000
elapsed : 1.841541 s
QPS : 5430234
ns/op : 0.1841541 ns
path : /1/foo
handler : 1
Memory : 109.89 MB
after removed:
RADIX_ROUTER_ROUTES=100000 RADIX_ROUTER_TIMES=10000000 luajit benchmark/simple-variable.lua
========== variable ==========
routes : 100000
times : 10000000
elapsed : 1.511881 s
QPS : 6614277
ns/op : 0.1511881 ns
path : /1/foo
handler : 1
Memory : 109.48 MB
The memory usage is basically the same