Skip to content

Commit de20491

Browse files
Merge pull request #1102 from codeflash-ai/codeflash/optimize-pr1086-2026-01-17T11.16.14
⚡️ Speed up method `TestFiles.get_test_type_by_original_file_path` by 73% in PR #1086 (`fix-path-resolution/no-gen-tests`)
2 parents 7bdef6c + 0f7ff37 commit de20491

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

codeflash/models/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
from collections import Counter, defaultdict
4+
from functools import lru_cache
45
from typing import TYPE_CHECKING
56

67
import libcst as cst
@@ -411,6 +412,7 @@ def get_test_type_by_original_file_path(self, file_path: Path) -> TestType | Non
411412
)
412413

413414
@staticmethod
415+
@lru_cache(maxsize=4096)
414416
def _normalize_path_for_comparison(path: Path) -> str:
415417
"""Normalize a path for cross-platform comparison.
416418

0 commit comments

Comments
 (0)