MCPcopy Index your code
hub / github.com/python/cpython / from_cache

Function from_cache

Tools/importbench/importbench.py:41–49  ·  view source on GitHub ↗

sys.modules

(seconds, repeat)

Source from the content-addressed store, hash-verified

39 yield count // seconds
40
41def from_cache(seconds, repeat):
42 """sys.modules"""
43 name = '<benchmark import>'
44 module = types.ModuleType(name)
45 module.__file__ = '<test>'
46 module.__package__ = ''
47 with util.uncache(name):
48 sys.modules[name] = module
49 yield from bench(name, repeat=repeat, seconds=seconds)
50
51
52def builtin_mod(seconds, repeat):

Callers

nothing calls this directly

Calls 1

benchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…