My hypothesis is that
The different architectures of Dash, Panel and Streamlit makes a difference if you want to create snappy applications.
Framework | Server | Communication Protocol | Built in state | Update cycle |
---|---|---|---|---|
Dash | Flask | http | No | Specific code reruns and UI updates |
Panel | Tornado | web sockets | Yes, Automatic | Specific code reruns and UI updates |
Streamlit | Tornado | web sockets | Yes, Manual | Rerun script top to bottom with caching |
I want to test that hypothesis and elaborate on it.
In order to fairly and reproducibly compare the frameworks I will pin requirements as much as possible and run in Docker.
You can build with
docker build -f "Dockerfile" -t dataappperformance:latest "."
and run interactively with
docker run --rm -it -p 80:80 dataappperformance:latest
You can list all tests with
$ docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke --list'
Available tasks:
page-load.dash
page-load.panel
page-load.streamlit
slider-plot.dash
slider-plot.panel
slider-plot.streamlit
So to run for example the Panel slider-plot app you would run
docker run --rm -it -p 80:80 dataappperformance:latest -c 'invoke slider-plot.panel'
To run the page load test you would have to add port 8089 to the mix like
docker run --rm -it -p 80:80 -p 8089:8089 dataappperformance:latest -c 'invoke page-load.panel'
Click the images to dive into the test and its results
Only works for Panel
Dash clear winner. Panel server shows blocking behaviour. Streamlit is very fast in theory but probably slowest in practice.