Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lingering Block allocation #1867

Merged
merged 1 commit into from Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions hypothesis-python/RELEASE.rst
@@ -0,0 +1,4 @@
RELEASE_TYPE: patch

This release removes some redundant code that was no longer needed but was still running a significant amount of computation and allocation on the hot path.
This should result in a modest speed improvement for most tests, especially those with large test cases.
11 changes: 0 additions & 11 deletions hypothesis-python/src/hypothesis/internal/conjecture/data.py
Expand Up @@ -682,17 +682,6 @@ def draw_bits(self, n, forced=None):
self.start_example(DRAW_BYTES_LABEL)
initial = self.index

block = Block(
start=initial,
end=initial + n_bytes,
index=len(self.blocks),
forced=forced is not None,
all_zero=result == 0,
)

if block.forced:
self.forced_indices.update(hrange(block.start, block.end))

self.buffer.extend(buf)
self.index = len(self.buffer)

Expand Down