From da66e8353442fcb3f0bde963fbdb29c8ad84256a Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Mon, 30 Dec 2024 15:06:56 +0100 Subject: [PATCH] Don't re-scan the source tree in scripts/languages/update_all.py Only compute the result once. This brings down the time spent from 3.5 seconds to 700 milliseconds on my device. --- scripts/languages/twlang.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/languages/twlang.py b/scripts/languages/twlang.py index a5758435974..3374431cfd3 100644 --- a/scripts/languages/twlang.py +++ b/scripts/languages/twlang.py @@ -1,3 +1,4 @@ +import functools import os import re from collections import OrderedDict @@ -58,6 +59,7 @@ def check_file(path): return matches +@functools.lru_cache(None) def check_folder(path): englishlist = OrderedDict() for path2, dirs, files in os.walk(path):