You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
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.