Releases: api7/lua-resty-radixtree
Releases · api7/lua-resty-radixtree
v2.4
v2.3
perf: make inserting host match route several times faster (#62) Previously, `insert_route` will sort the table with `table.sort`. The `table.sort` is implemented via quick-sort, which is in O(nlogn) complexity and perform worse when the table is already mostly sorted. Since we can ensure the table is sorted before inserting, we can implement a naive insert sort in O(n) complexity to replace `table.sort`. Via `time resty -I=./lib -I=./deps/share/lua/5.1 benchmark/match-hosts.lua` I see an impressive time reduction with this optimization.