You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I profile a hypothesis run (with use_coverage off), I see that 11% of the time is taken by hypothesis.internal.conjecture.engine:398:debug_data. Looking more closely, this function takes time generating data for the debugging log, even when that log is turned off. Let's please make this more lazy.
A very simple (but not elegant) solution is:
--- hypothesis/internal/conjecture/engine.py+++ hypothesis/internal/conjecture/engine.py@@ -26,6 +26,7 @@ from collections import defaultdict
import attr
from hypothesis import settings as Settings
+from hypothesis import Verbosity
from hypothesis import Phase, HealthCheck
from hypothesis.reporting import debug_report
from hypothesis.internal.compat import EMPTY_BYTES, Counter, ceil, \
@@ -396,6 +397,8 @@ class ConjectureRunner(object):
debug_report(message)
def debug_data(self, data):
+ if self.settings.verbosity < Verbosity.debug:+ return
buffer_parts = [u"["]
for i, (u, v) in enumerate(data.blocks):
if i > 0:
The text was updated successfully, but these errors were encountered:
Hmm. I've just traced this through, and we could pass a thunk to make string construction lazy. I tend to think though that with only two calls it's more elegant just to check verbosity before calling the method. I'll open a pull.
When I profile a hypothesis run (with use_coverage off), I see that 11% of the time is taken by
hypothesis.internal.conjecture.engine:398:debug_data. Looking more closely, this function takes time generating data for the debugging log, even when that log is turned off. Let's please make this more lazy.A very simple (but not elegant) solution is:
The text was updated successfully, but these errors were encountered: