Pedestal

Prefix Tree Router

Motivation

Provide a performant router which is efficient in time and space.

It’s Modeled after httprouter.

Why use it?

Most performant builtin router when dynamic routes (i.e, path parameters, wildcards) are required. Routes requests in logarithmic time.

How to use it?

Add the key :io.pedestal.http/router to the service map with the value :prefix-tree.

Caveats

Provides less control over routing. For example, Wild card routes always win. The path /foo/:bar will always match over /foo/baz.

Additional Notes

Like the Map Tree Router, query and path contraints are not used in routing decisions. They are only used to invalidate a route match.

References