From 21ea425539d93a9005e6a7e430bef0f4be4aaeae Mon Sep 17 00:00:00 2001 From: "David R. MacIver" Date: Wed, 13 Mar 2019 09:47:37 +0000 Subject: [PATCH] Remove lingering Block allocation --- hypothesis-python/RELEASE.rst | 4 ++++ .../src/hypothesis/internal/conjecture/data.py | 11 ----------- 2 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 hypothesis-python/RELEASE.rst diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst new file mode 100644 index 0000000000..7810db2280 --- /dev/null +++ b/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. diff --git a/hypothesis-python/src/hypothesis/internal/conjecture/data.py b/hypothesis-python/src/hypothesis/internal/conjecture/data.py index f2924b5526..507d641598 100644 --- a/hypothesis-python/src/hypothesis/internal/conjecture/data.py +++ b/hypothesis-python/src/hypothesis/internal/conjecture/data.py @@ -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)