From 3aca197d7a8299352378d1ff140afe4dd32da70b Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 1 Jan 2015 19:47:05 +0000 Subject: [PATCH] Updated readme to note optimized static routes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 5db32f8..a6addea 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,11 @@ $myRouter->respond(); See [Routes](https://github.com/pjdietz/wellrested/wiki/Routes) to learn about the various route classes. +#### Optimized Route Lookup + +StaticRoute routes are optimized by providing a direct lookup from path to handler. This is different from convential lookups because a match must be found by iterating through the entire list of routes in the router. This reduces the lookup complexity from O(n) - linear - to O(1) - constant. + + ### Handlers Any class that implements [`HandlerInterface`](src/pjdietz/WellRESTed/Interfaces/HandlerInterface.php) may be the handler for a route. This could be a class that builds the actual response, or it could be another [`Router`](src/pjdietz/WellRESTed/Router.php).