-
Notifications
You must be signed in to change notification settings - Fork 90
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
test_plot_cdfs
test is extremely slow
#298
Comments
Should be easy to replace the data with a smaller dataset. |
Performance profile: Looks like matplotlib's For the test itself, smaller dataset would indeed work. |
No idea why autoscale_view is called so often. There are 63 calls to plot_individual_cdf, so that is close 400 calls to autoscale per cdf (this is not the only place where autoscale might be called, but likely the dominant one). It's also strange to autoscale because at least the x-axis has a clearly defined hard-coded limit. It seems this arises from somewhere deep within matplotlib. |
The calls to scatter in |
Just ran a quick test. With scatter enabled timeit gives
With scatter disabled, and replaced with the marker kwarg in plot we get
So, disabling scatter gives us orders of magnitude improvement, and no discernable difference in the visual. |
That's 2 orders of magnitude, or a 99% reduction in runtime. Seems worth it. Are there any figures where the scatter is likely required to provide a correct/useful visual? If so we should test those. |
I did a visual comparison. It is really marginal. |
Then the speedup sounds worth it! |
This test takes extremely long, in the order of minutes. I wouldn't be surprised if it's over half of all testing time.
EMAworkbench/test/test_analysis/test_regional_sa.py
Lines 14 to 23 in b76b487
The text was updated successfully, but these errors were encountered: