-
Notifications
You must be signed in to change notification settings - Fork 30
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"greedy traversal" test performance #146
Comments
Very interesting. See also #135. |
@moodmosaic yes, I suspect there are a bunch more easy fixes like this 🙂 |
Fixed in #147 and released as Hedgehog 0.6. |
Just want to let you guys know that this reduced my test suite for a small-ish project (156 tests) from 14 seconds to 4 seconds. Great job, keep it up! 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the test in question:
fsharp-hedgehog/tests/Hedgehog.Tests/MinimalTests.fs
Lines 65 to 89 in 1dfb754
I ran this under the profiler and the problem is entirely due to the
sprintf
inforAll
:fsharp-hedgehog/src/Hedgehog/Property.fs
Lines 276 to 281 in 1dfb754
Replacing this with
x.ToString()
reduces the runtime from to 40 s to 0.55 s (!)However,
ToString
isn't as useful assprintf "%A"
for 'native' F# types. A better fix would be to make this function lazily-invoked, so that it's only called if needed.The text was updated successfully, but these errors were encountered: