From b9a3870a3aafb20a9c9c0ff3247b33d4e2c0d429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ded=C3=ADk?= Date: Thu, 16 Jun 2022 11:28:45 +0200 Subject: [PATCH] Cache datetimes --- neon/tokens.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neon/tokens.py b/neon/tokens.py index 972e80e..1f108d2 100644 --- a/neon/tokens.py +++ b/neon/tokens.py @@ -1,3 +1,5 @@ +import functools + import dateutil.parser from . import errors @@ -150,6 +152,7 @@ class DateTime(Primitive): re = None @classmethod + @functools.lru_cache(maxsize=None) def convert(cls, string): try: return dateutil.parser.parse(string)