Commits

Kirill Simonov committed 6a336bb

Fixed performance issue with routing process.

  • Participants
  • Parent commits c6b3a74

Comments (0)

Files changed (1)

src/htsql/core/tr/route.py

 
 class RoutingState(object):
 
+    def __init__(self):
+        self.cache = {}
+
     def route(self, binding):
+        if binding in self.cache:
+            return self.cache[binding]
         with translate_guard(binding):
-            return Route.__invoke__(binding, self)
+            flow = Route.__invoke__(binding, self)
+            self.cache[binding] = flow
+            return flow
 
 
 class Route(Adapter):