do, static segments will be given higher priority: ```rust # use matchit::Router; # fn main() -> Result<(), Box> { let mut m = Router::new(); m.insert("/", "Welcome!").unwrap(); // priority: 1 m.insert("/about", "About Me").unwrap(); // priority: 1 m.insert("/{*filepath}", "...").unwrap(); // priority: 2 # Ok(()) # } ``` # How does it work? The router takes advantage of the fact that URL routes generally follow a hierarchical structure. Routes are stored them in a radix trie that makes heavy use of common prefixes. ```text Priority Path Value 9 \ 1 3 ├s None 2 |├earch\ 2 1 |└upport\ 3 2 ├blog\ 4 1 | └{post} None 1 | └\ 5 2 ├about-us\ 6 1 | └team\ 7 1 └contact\ 8 ``` This allows us to reduce the route search to a small number of branches. Child nodes on the same level of the tree are also prioritized by the number of children with registered values, increasing the chance of choosing the correct branch of the first try. As it turns out, this method of routing is extremely fast. See the [benchmark results](https://github.com/ibraheemdev/matchit?tab=readme-ov-file#benchmarks) for details.