Skip to content

Commit f99d32d

Browse files
committed
Add benchmark for iterating over modules in graph
We do this currently in import-linter remove_ignored_imports.
1 parent 3510cb4 commit f99d32d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/benchmarking/test_benchmarking.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,3 +430,11 @@ def f(n):
430430
_ = f"foo{i}" in large_graph.modules
431431

432432
_run_benchmark(benchmark, f, 100)
433+
434+
435+
def test_iterate_over_modules_in_graph(large_graph, benchmark):
436+
def f():
437+
for module in large_graph.modules:
438+
_ = module
439+
440+
_run_benchmark(benchmark, f)

0 commit comments

Comments
 (0)