Skip to content

Commit

Permalink
Add benchmark for iterating over modules in graph
Browse files Browse the repository at this point in the history
We do this currently in import-linter remove_ignored_imports.
  • Loading branch information
Peter554 committed Feb 6, 2025
1 parent 3510cb4 commit f99d32d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/benchmarking/test_benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,11 @@ def f(n):
_ = f"foo{i}" in large_graph.modules

_run_benchmark(benchmark, f, 100)


def test_iterate_over_modules_in_graph(large_graph, benchmark):
def f():
for module in large_graph.modules:
_ = module

_run_benchmark(benchmark, f)

0 comments on commit f99d32d

Please # to comment.