File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ fn main() -> Result<(), Box<dyn Error>> {
139139}
140140```
141141
142- ```
142+ ``` text
143143/
144144├─ backups/
145145│ ╰─ <*path>
@@ -161,6 +161,21 @@ fn main() -> Result<(), Box<dyn Error>> {
161161 ╰─ /message
162162```
163163
164+ ## Implementation details
165+
166+ ` wayfind ` uses a compressed radix trie for its data storage.
167+ This is the common backbone of almost all routers implemented in Rust.
168+
169+ What sets ` wayfind ` apart is its search strategy.
170+ Most routers either use "first match wins" or "best match wins" (via backtracking), ` wayfind ` uses a hybrid approach:
171+
172+ - per segment: first match wins
173+ - within segment: best match wins
174+
175+ You only pay the cost of backtracking if you make use of inline parameters, and only for that given segment.
176+
177+ This can result in some matches which may be unexpected, but in practice it works well for real-world usage.
178+
164179## Performance
165180
166181` wayfind ` is fast, and appears to be competitive against other top performers in all benchmarks we currently run.
Original file line number Diff line number Diff line change 136136//! See [`Errors`](errors) for examples.
137137
138138#![ no_std]
139-
140139extern crate alloc;
141140
141+ #[ cfg( doctest) ]
142+ #[ doc = include_str ! ( "../README.md" ) ]
143+ mod readme_doctests { }
144+
142145pub mod errors;
143146
144147mod node;
You can’t perform that action at this time.
0 commit comments