marcskovmadsen / data-app-performance Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
In this test I would like to test the initial page load. One way to test this is the time between request is sent and response is received. For Dash this will be an ok measure. But for Streamlit and Panel this is only part of the answer. Because they don't transfer everything in the request-response cycle. Streamlit only transfers a minimum amount of data to open a web socket connection. The rest is transfered through that. Panel is somewhere in between Streamlit and Dash. It transfers parts of the response initially. But opens a web socket to transfer the rest. So I figured I would do a first test of how long time it takes before the user actually sees a rendered page.
docker run --rm -it -p 80:80 -p 8089:8089 dataappperformance:latest -c 'invoke page-load.dash'
docker run --rm -it -p 80:80 -p 8089:8089 dataappperformance:latest -c 'invoke page-load.dash'
As you can see in the screenshot Panels performance is orders of magnitude lower. One minor cause is probably that it sends the most data across. But as you can also see the max response time is +1min. As you can see in the video below the server is not responding at all for more than a minute. As Streamlit and Panel are both running on the Tornado server I would expect them both to be pretty quick. I've filed a bug report with Panel here holoviz/panel#3105. I believe something in the implementation of the Bokeh/ Panel server must be wrong.
docker run --rm -it -p 80:80 -p 8089:8089 dataappperformance:latest -c 'invoke page-load.streamlit'
If you are making apps for 1-30 users that are not refreshing often as I am the Panel issue is not that significant. But it will be expensive to scale to a lot of concurrent users currently.
The videos have been speeded up 4 times to be able to upload them.
Here we just click the refresh button as fast as we "feel" its possible to do.
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.dash'
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.panel'
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.streamlit'
I've created a basic application with a slider and a Plotly plot. I want to explore my data/ model interactively by dragging the slider fast back and forth.
As you can see below only Panel can deliver the performance needed.
You can find the source code here.
Framework | Supports drag events | Snappy experience | Comment |
---|---|---|---|
Dash | yes | no | Dash supports dragging the slider but quickly gives up |
Panel | yes | yes | No problem |
Streamlit | no | no | Seems not supported. |
For example Dask Dashboard is developed in Bokeh and is very, very performant. I don't believe its possible to build a performant application like that in Streamlit or Dash. It would be in Panel though.
I would expect interactive applications with streaming to perform much better in Panel than Dash. Streamlit does not really support interactive applications with streaming.
Another noticeable difference is just how much code it takes to make a basic Dash application.
https://user-images.githubusercontent.com/42288570/149649005-24f9f4d2-b84f-45d2-888a-c2b4b618c66b.mp4
https://user-images.githubusercontent.com/42288570/149649006-44307849-273b-4b35-b3f1-bf657f8b5a36.mp4
https://user-images.githubusercontent.com/42288570/149649007-eca75cf9-fdf6-4304-85ef-6eea26ccd3c0.mp4
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.panel'
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.streamlit'
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.dash'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.