From b89f9a57e0e4b10fcd4c0a6585e9f76d4042673d Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Tue, 9 Feb 2021 16:39:03 +0200 Subject: [PATCH] static performance increase --- sanic/router.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sanic/router.py b/sanic/router.py index 2d0ef5be..3b667a63 100644 --- a/sanic/router.py +++ b/sanic/router.py @@ -23,6 +23,10 @@ class Router(BaseRouter): DEFAULT_METHOD = "GET" ALLOWED_METHODS = HTTP_METHODS + # Putting the lru_cache on Router.get() performs better for the benchmarsk + # at tests/benchmark/test_route_resolution_benchmark.py + # However, overall application performance is significantly improved + # with the lru_cache on this method. @lru_cache(maxsize=ROUTER_CACHE_SIZE) def _get(self, path, method, host): try: