-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Performance issue: @DataPoints called N+1 times for each theory #82
Comments
Sorry that no progress has been made on this issue in 3 years! Are you still interested in a solution? |
@bloritsch, I'm assuming it became no longer an issue. Closing for now. |
This is still an issue as of 4.12 and can cause a huge unexpected performance hit. Minimal exampleFor
Output
In general, for WorkaroundIt is an easy-enough workaround to store the generator output once and annotate the variable with
Output
Should this be re-opened and addressed? |
Add Log4J method to MDC to workaround use in wild. Makes a copy of the map, good practice.
I created a set of theories to verify the equals(), hashCode()
relationship. While I had the equals and reciprocal equals working
properly, I was surprised at the unintended hashCode collisions I had in
my code. More importantly I was surprised at how often the @DataPoints
method was called to set up the tests. It was called no less than 61
times for 60 discrete data points. That seems a bit excessive to me.
I set up a bunch of data with the assumption that it was set up once,
and then the contents were copied as needed. Essentially the expensive
set up work is done 61 times, accounting for a large portion of the 37
seconds it takes to run all my tests. If the @DataPoints method is only
called once, and the values are copied as necessary, then the
implementation would be much faster.
The text was updated successfully, but these errors were encountered: