-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
add a validate=False
option for graph_objects
and px
figures
#1812
Comments
Also related to https://community.plot.ly/t/plotting-large-number-of-graphs/35907. |
To be checked: can we do this and still keep the magical underscore methods? Also possible: half-way point where we would disable the validation of only data arrays. Note that the "import" time is a big part of the lag when developing |
Any update on this? certainly have my +1, using large data sets with datashader and it's taking seconds to validate. Likely will have to retrofit my code with the dict methods :( |
@parksj10 can you confirm you’re seeing performance issues with a version of plotly of 4.7 or higher? We made a number of performance improvements in 4.7 so I just want to make sure :) |
@nicolaskruchten running plotly 4.8.1, I've attached a cProfile below, you can see that half the figure generation time is spent validating. In case you're interested, I've also attached the cProfile .dat file. Let me know if I can do anything else to help or provide other information. I think it would be rather difficult to create a low-complexity, working example from my app, but perhaps @michaelbabyn 's examples could be useful in this regard |
Thanks! This is something we should fix, and we’d appreciate any help :) |
I'm running into this, a few years later 🙂. This causes major issues when working with e.g. choropleth maps with large GeoJSON files, where you will end up with giant JSON blobs that certainly do not need to be validated. I imagine this is a pretty common issue for folks working with charts with many points, and I had no idea this was even a thing until today. It'd be great at least to document this behaviour or make people more aware of it until it's possible to disable validation. Maybe even on https://plotly.com/python/webgl-vs-svg/? |
I like the idea of a three-level approach: full validation (current behavior), top-level validation (don’t dig into data arrays or nested objects like GeoJSON), and no validation. |
(want to note as well that I'm seeing ~1second validation time/mb of object. With GeoJSONs, we often see blobs in the size of 60mb+, which just destroys your app performance.) Having the top-level validation option seems perfect! |
So independently of the validation issue, if the GeoJSONs are static, you should always load them from |
Yes, of course, although the last time we tried, we were unable to make it work :) |
@nicolaskruchten -- yes, I'm able to mostly get around this issue by using My main concern here is that this isn't intuitive, and it's also not intuitive that you can boost performance of figures in Dash apps with a large number of points just by switching how they are defined (which is why it'd be great to at least see this behaviour documented). |
(cc @red-patience / @LiamConnors on that last point maybe) |
Throwing my support behind this one! Even if it takes some time to add in a Both this trick and passing data as a static |
I think I have a related issue affecting from plotly.subplots import make_subplots
%time fig = make_subplots(rows=20, cols=20) From profiling, it is spending the vast majority of its time in the EDIT: I think I will make a new issue for this: see #4100 |
Thanks for that profiling! We could probably speed things up by only computing error strings when we know there's an error... |
validate=False
an option for graph_objects
and px
Figures?validate=False
option for graph_objects
and px
figures
There's already an issue outlining the effects
graph_object
validation has on plot generation time. Users can bypass this performance hit by replacing thegraph_objects
withdict
and then display the plot withplotly.offline.iplot(fig, validate=False)
or if they are creating graphs in Dash, they can forgo theplotly.py
library altogether and just use adict
in their Graph component'sfigure
argument.This solution can greatly improve the performance of Dash apps but it means that Dash users with expensive graphs have to choose between using
px
/plotly.py'supdate
methods and optimally fast code.I wonder if a way to turn off validation, especially in Dash apps, would help Dash users get the best of both worlds.
cc @matthewchan15
The text was updated successfully, but these errors were encountered: