projects
/
mdis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5612b8
)
dispatcher: cache dispatch calls
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 18 Jun 2023 18:52:19 +0000
(21:52 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 18 Jun 2023 18:52:19 +0000
(21:52 +0300)
src/mdis/dispatcher.py
patch
|
blob
|
history
diff --git
a/src/mdis/dispatcher.py
b/src/mdis/dispatcher.py
index 3825b9efc5be94c3097daf8142465f48053f9e78..a23cd027315ec64ba77ff35ae5e354bf0fba63ac 100644
(file)
--- a/
src/mdis/dispatcher.py
+++ b/
src/mdis/dispatcher.py
@@
-5,6
+5,7
@@
__all__ = [
]
import collections
+import functools
import inspect
import types
@@
-68,6
+69,7
@@
class DispatcherMeta(type):
return super().__new__(metacls, name, bases, ns)
+ @functools.lru_cache(maxsize=None)
def dispatch(cls, typeid=object):
hook = cls.__hooks__.get(typeid)
if hook is not None: