plotly / dash-slicer

A volume slicer for Dash
https://dash.plotly.com/slicer
MIT License
24 stars 8 forks source link

Add script to check performance #23

Closed almarklein closed 3 years ago

almarklein commented 3 years ago

I was looking for ways to improve the performance of the slicer, and decided to do a bit of benchmarking. This adds a script to test the performance of updating an image with Plotly+Dash.

It contains a dcc.Interval that tries to update a figure as fast as it can. The time it costs to do this will slow the interval down, so we can measure fps. Of course this FPS value depends on a lot of factors, but it's valuable to see the differences between methods.

Some observations:

In summary, I had hoped the glheatmap would allow us to get more smooth interaction. Alas. On the plus side, we seem to have some internal overhead that we can hopefully fix to make things more smooth!

emmanuelle commented 3 years ago

A question about serialization: did you compute the JSON serialization time of the figure? If it's a significant fraction of the time it might explain why the difference between heatmap and heatmapgl is not huge. (and are you using plotly 4.13 which should reduce the serialization time for Heatmap and Heatmapgl ?)

Update: forget what I wrote, since the callback is clientside probably there is no serialization

emmanuelle commented 3 years ago

I tried the same benchmark on larger (256x512x512) and random uint8 (worst case for png compresseion) data and

emmanuelle commented 3 years ago

Note that the performace of the noop and empty modes are improved when setting the update_title of the app to None:

app = dash.Dash(__name__, update_title=None)

also see https://dash.plotly.com/external-resources. I think this also slightly improves the png mode.

almarklein commented 3 years ago

I added update_title=None. I'm surprised at how much this improves the performance ...