lua-radix-router icon indicating copy to clipboard operation
lua-radix-router copied to clipboard

perf: try to remove the trie metatable

Open vm-001 opened this issue 2 years ago • 0 comments

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

vm-001 avatar Jan 09 '24 12:01 vm-001