-
Notifications
You must be signed in to change notification settings - Fork 34
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
Do not ask for equals/hashCode on the sequential specification until necessary #135
Comments
These messages are really annoying...
|
We need to make experiments to decide when |
Let's also remove the |
As experiments have shown, there is no explicit correlation between equals/hashcode presence and verification time and a whole test time. Equals and hashcode can significantly improve or mess up performance only if a scenario is really big. In real tasks it can be if threads count is >= 4.
The graph below describes whether equals / hashcode improves or worsens verification time. The x-axis value is equal to the difference between the verification time without equals / hashcode and with equals / hashcode in milliseconds for the same experiment. The y-axis is the number of threads. In most tests, there is not much difference, but on those where the difference is significant, the presence of equals / hashcode often worsens the results. According to the current results of the experiments, it was decided to mark VeriferState as @deprecated and completely remove the warning about the absence of equals / hashcode, since this option can not only improve, but also worsen the running time and also complicates the use of the framework. |
These results are really surprising, thanks @avpotapov00 for the analysis! |
@avpotapov00, could you please check whether it is better to use |
It would be better to show the percentage of the time spent in the verification phase. |
So I propose to keep current |
@avpotapov00 |
fixed in #160 |
Usually, the verification phase is super-fast, even with default
equals
andhashCode
implementations. However, it might be critical to provide custom implementations when testing scenarios are large or when the data structure operations are expensive.Let's not require
equals
/hashCode
to be implemented if the verification phase takes excepted time -- Lincheck should neither throw an exception nor print a warning. However, when the verification process takes an unexpectedly long time, it would be helpful to print a warning with instructions on how to implementequals
andhashCode
.The text was updated successfully, but these errors were encountered: