-
Notifications
You must be signed in to change notification settings - Fork 42
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
Derive Clone for App #55
Conversation
Hi @ewoolsey!, just to make things clearer, could you provide an example of such test suite where the |
@ewoolsey I am closing this PR as no answer received. This PR can be reopened in the future if there will be a reason to add requested derives to Remark/workaround: I hope this helps. |
Hey sorry for missing the reply my apologies. Yes your workaround is what I'm currently doing. This is very computationally expensive when performing 10 thousand randomized tests. Being able to clone this structure would be ideal. As far as I'm aware there are exactly no down sides to deriving |
For more context, I have very complicated setup procedure for my app, around 500 lines or so. This base state is then modified using an rng to test edge cases. Running my 500 line setup procedure 10000 times in incredible slow. |
@ewoolsey Just let me know if using Clone is the performance better in your case. Thanks. |
Just did a quick benchmark and one of my fuzz tests had a 5x perf improvement :) Thanks for approving the PR. Really appreciate it! |
This is useful in testing. It's common to run a complicated setup procedure to build an app state, then to run different tests on that app. Rather that constantly rebuilding the state this allows you to clone it around.
It seems that perhaps other useful derives are missing as well (Debug being an obvious one). Though I don't immediately have a use case for that.