-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
2-4x performance regression for Plots.plot in Julia 1.6 vs. 1.5.3 #39509
Comments
This is likely expected, since a lot of work has gone into reducing compiler latencies for applications like plotting where runtime cost is typically negligible. As a consequence calls to |
Actually I would disagree. I generate a significant number of plots with a lot more data points than this trivial example. The difference in real world situation end up being a factor of 6-8x. It's 30 seconds vs 4 minutes. That's a large impact on productivity. |
An analysis of a profile would be helpful in understanding the slowdown. |
One thing you could also try is uncommenting these three lines in Plots.jl: https://github.com/JuliaPlots/Plots.jl/blob/a04946e8320df5ad19559d674ef44fa7201dc2c1/src/Plots.jl#L3 |
Here is another trivial example where the performance regression is even more dramatic (4-5x): v1.5.3:
v1.6b1:
|
When I generate a profile here is what it looks like for Julia 1.5.3:
|
And here what the profile look like for Julia 1.6b1:
|
That seems to have way too few samples to be a useful profile data. You probably need to run the function more times to get statistically representative data. |
Ok, I defined the following function and reran profile.
Julia 1.5.3:
|
And here is the profile for Julia 1.6 b1:
|
You can use the |
I restarted with clean Julia environment, ran the plotting code once, then reran the profiles for each version of Julia. The comments above are updated with the the |
Okay, so it seems it is the showing of types that got slower? Maybe #37990? |
Any chance this issue can be addressed before 1.6 release? It would be nice to be able take advantage of all the other advances that 1.6 has to offer, otherwise I'm stuck with 1.5 for my application. |
As a fix, it looks as if this string computation in If instead the string is computed only if the warning is determined to appear, this slowdown should go away. Is that correct @daschw? |
In general type display is slow now because we search module namespaces for aliases for nicer printing. (I really like the new printing, but we should speed it up. CC @vtjnash.) |
You can also set |
Where do I set this when using Plots? |
It looks like it has to be done inside RecipesPipeline. But it also seems the type stringification it's doing is not even necessary (#39509 (comment)). |
This is not something you can do if you are just using the package. I've made an issue to track this in Plots: JuliaPlots/Plots.jl#3276 |
Should the issue be closed, since closed/fixed in Plots.jl? I do not want this to hold up Julia 1.6 release... |
The fix for the Plots slowdown was merged. I don't know if there needs to be an issue for the type show method slowdown, though there's already #37990 |
I think #37990 is probably the best issue to track this, as it has a nice simple MWE. |
I'm experiencing a large performance regression (2-3x) using Plots.plot function when comparing Julia 1.6 beta1 with 1.5.3. Similar results when using plotly backend.
Julia 1.5.3:
Julia 1.6b1:
The text was updated successfully, but these errors were encountered: