@@ -664,7 +664,7 @@ def __init__(
664664 for module in CORE_BUILTIN_MODULES :
665665 if options .use_builtins_fixtures :
666666 continue
667- path = self .find_module_cache .find_module (module )
667+ path = self .find_module_cache .find_module (module , fast_path = True )
668668 if not isinstance (path , str ):
669669 raise CompileError (
670670 [f"Failed to find builtin module { module } , perhaps typeshed is broken?" ]
@@ -2725,7 +2725,9 @@ def exist_added_packages(suppressed: list[str], manager: BuildManager, options:
27252725
27262726def find_module_simple (id : str , manager : BuildManager ) -> str | None :
27272727 """Find a filesystem path for module `id` or `None` if not found."""
2728- x = find_module_with_reason (id , manager )
2728+ t0 = time .time ()
2729+ x = manager .find_module_cache .find_module (id , fast_path = True )
2730+ manager .add_stats (find_module_time = time .time () - t0 , find_module_calls = 1 )
27292731 if isinstance (x , ModuleNotFoundReason ):
27302732 return None
27312733 return x
@@ -2734,7 +2736,7 @@ def find_module_simple(id: str, manager: BuildManager) -> str | None:
27342736def find_module_with_reason (id : str , manager : BuildManager ) -> ModuleSearchResult :
27352737 """Find a filesystem path for module `id` or the reason it can't be found."""
27362738 t0 = time .time ()
2737- x = manager .find_module_cache .find_module (id )
2739+ x = manager .find_module_cache .find_module (id , fast_path = False )
27382740 manager .add_stats (find_module_time = time .time () - t0 , find_module_calls = 1 )
27392741 return x
27402742
0 commit comments