diff --git a/packages/core/src/robotcode/core/utils/path.py b/packages/core/src/robotcode/core/utils/path.py index 35f181453..c9394d53c 100644 --- a/packages/core/src/robotcode/core/utils/path.py +++ b/packages/core/src/robotcode/core/utils/path.py @@ -1,3 +1,4 @@ +import functools import os import re import sys @@ -61,6 +62,7 @@ def normalized_path_full(path: Union[str, "os.PathLike[str]"]) -> Path: return Path(*parents) +@functools.lru_cache(maxsize=100_000) def same_file(path1: Union[str, "os.PathLike[str]", Path], path2: Union[str, "os.PathLike[str]", Path]) -> bool: try: return os.path.samefile(path1, path2) diff --git a/packages/robot/src/robotcode/robot/utils/variables.py b/packages/robot/src/robotcode/robot/utils/variables.py index 877d6612b..9e4076f02 100644 --- a/packages/robot/src/robotcode/robot/utils/variables.py +++ b/packages/robot/src/robotcode/robot/utils/variables.py @@ -215,7 +215,7 @@ def is_variable(string: str, identifiers: str = "$@&") -> bool: return cast(bool, robot_is_variable(string, identifiers)) -@functools.lru_cache(maxsize=1024) +@functools.lru_cache(maxsize=100_000) def search_variable( string: str, identifiers: str = "$@&%*", parse_type: bool = False, ignore_errors: bool = False ) -> VariableMatcher: