-
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
Replace BigInt
with a native type
#371
Comments
Can you first create benchmarks in the benchmark project using |
Would love for Hedgehog to be faster. While I will continue using Hedgehog over FsCheck due to integrated shrinking, the significantly slower performance is a notable drawback in several of my test suites. Alternatively, better performance could allow using a higher test count with no loss of test suite runtime. |
@cmeeren, for any pair of BenchmarkDotNet tests you create comparing Hedgehog and FsCheck, I will do my best to optimize Hedgehog to be competitive in that comparison. This is helpful for me for two reasons. First, between this issue and the linked one from the OP, you seem to know of many places in Hedgehog that are slow. Second, you know how to use FsCheck and what the equivalent would be. Want to take me up on this offer? |
Thanks for the challenge, @TysonMN! "Unfortunately", all those years back when I posted the linked issue, I ended up using Hedgehog after all (integrated shrinking was the tipping factor). I never used FsCheck much, and it's been so long that I've forgotten everything about it. (I can't even remember if I ever used it seriously or just experimented with it; my guess is the latter.) I certainly have no FsCheck code left anywhere; I think even the codebases where I used it for testing now no longer exist at all. Also, for now, my "OSS quota" will be filled working on Faqt (also a testing-related library, as it happens). So unfortunately I'm going to have to decline the request. |
Our use of
BigInt
internally is the cause of some slowness, and I've shown in #135 (comment) that by replacing it we can get immediate efficiency improvements. This however can't be done naively, so we'll need to consider how we support generation ofuint64
,int64
,double
, andbigint
with a different internal type.Something we may want to consider is grouping numeric types into a few categories:
int8
,int16
,int32
,int64
)uint8
,uint16
,uint32
,uint64
)single
,double
)Then we can have one
integral
function for each category that uses the largest number in its category to generate from. This would help us avoid weird conversion issues and allow us to dropBigInt
internally.I do, however, think we should add a
Gen.bigint
function. But that is outside the scope of this issue, and should be considered on its own merit.Thoughts?
/cc @TysonMN @dharmaturtle @moodmosaic
The text was updated successfully, but these errors were encountered: