lua-resty-radixtree
lua-resty-radixtree copied to clipboard
Using the radixtree.new() method in a similar way has a performance difference of ten times
Environment
- APISIX 3.9.1
- CentOS Stream release 9
Description
I added a custom logic to the _M.match
method in radixtree_host_uri.lua
in APISIX to simulate how long it takes to build a radix tree with 1000 routes. At the same time, I used Python to call the Admin API of APISIX and added 1000 routes. When I executed curl -X GET http://localhost:9080/foo
, I was surprised to find that with the same number of routes, when using a similar method to call radixtree.new
to build a radixtree, the performance difference between the two was as much as ten times. Why is this?
-
Use python to call the Admin API of APISIX and added routes.
-
Added custom logic of
radixtree_host_uri.match()
-
Test