Skip to content

Commit

Permalink
small benchmark tweak for list iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
omry committed Feb 10, 2021
1 parent e5cfb4c commit ee02e9e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,8 @@ def test_list_in(lst: List[Any], benchmark: Any) -> None:
],
)
def test_list_iter(lst: List[Any], benchmark: Any) -> None:
# Performance is really bad for list config iteration, not sure why.
benchmark(lambda seq: [x for x in seq], lst)
def iterate(seq: Any) -> None:
for _ in seq:
pass

benchmark(iterate, lst)

0 comments on commit ee02e9e

Please sign in to comment.