Source w/ bytecode: small
(seconds, repeat)
| 134 | |
| 135 | |
| 136 | def source_using_bytecode(seconds, repeat): |
| 137 | """Source w/ bytecode: small""" |
| 138 | name = '__importlib_test_benchmark__' |
| 139 | with util.create_modules(name) as mapping: |
| 140 | sys.meta_path.append(importlib.machinery.PathFinder) |
| 141 | loader = (importlib.machinery.SourceFileLoader, |
| 142 | importlib.machinery.SOURCE_SUFFIXES) |
| 143 | sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader)) |
| 144 | py_compile.compile(mapping[name]) |
| 145 | assert os.path.exists(cache_from_source(mapping[name])) |
| 146 | yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat, |
| 147 | seconds=seconds) |
| 148 | |
| 149 | |
| 150 | def _using_bytecode(module): |
nothing calls this directly
no test coverage detected
searching dependent graphs…