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
Strategy does not implement Sync #12
Comments
also, any advice on speeding up generation of random strings? I'm seeing significant (i.e. 10x) slowdowns compared to quickcheck + regex_generate. |
one thing I did: reduce the number generated for tests that don't need a large number. Very hard to do with quickcheck! |
I originally wanted to leave the possibility of using interior mutability within a strategy. But as I found out trying to implement
That's somewhat expected. Proptest needs to build and retain a more complicated structure for shrinking to work correctly. The generation could also benefit a lot from small string optimisation; currently, each individual element of the regex becomes its own |
Thanks for the replies. It would be nice to add Sync. As for the slowdown, I think it's mostly fine -- obviously faster is always better :) It would probably be worth documenting eventually though, especially if a solution cannot be found. |
It turns out that adding The only other remaining internal use of |
@vitiral Would you be able to provide the regex in question? I started looking into optimising the string generation, but the regex I tried ( |
Here is the regex I am using:
|
originally I was using Hope that helps! |
The various string-generation strategies are now I also did look into the performance of string generation, and I believe the main bottleneck is actually character generation due to the inefficient way it accomplishes biasing towards particular characters. Changing that will likely require breaking backwards compatibility, so I'll make another pass at that at a later time. |
I've moved the regex performance concerns to a separate issue (#16) since the problem referenced by the title of this one has been fixed. |
Thanks! Wow, you are really responsive on these issues. Hope they were helpful for you as a lib designer! |
I'm not sure if there is a technical reason this is not possible, but I thought I would check.
I would like to create the regex strategy using
lazy_static!
but Strategies don't implement Sync.Thanks!
The text was updated successfully, but these errors were encountered: