Skip to content

Commit

Permalink
reduce example generation batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
tybug committed Nov 26, 2024
1 parent 4a79609 commit d795120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELEASE_TYPE: patch

When a user requests an interactive input via ``strategy.example``, we generate and cache a batch of 100 inputs and return the first one. As this initial batch can be expensive for large strategies, this patch reduces the batch size to 10.
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ def example(self) -> Ex:
@given(self)
@settings(
database=None,
max_examples=100,
# generate only a few examples at a time to avoid slow interactivity
# for large strategies. The overhead of @given is very small relative
# to generation, so a small batch size is fine.
max_examples=10,
deadline=None,
verbosity=Verbosity.quiet,
phases=(Phase.generate,),
Expand Down

0 comments on commit d795120

Please sign in to comment.