Skip to content
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

Hot reloading performance improvements #29

Closed
rpkyle opened this issue May 21, 2020 · 1 comment
Closed

Hot reloading performance improvements #29

rpkyle opened this issue May 21, 2020 · 1 comment
Labels
performance Issues related to Dash.jl performance

Comments

@rpkyle
Copy link
Contributor

rpkyle commented May 21, 2020

An initial experimental implementation of hot reloading in Dash.jl provided in #25 is essentially complete, and offers the same general level of functionality as found in Dash for Python or Dash for R.

However, the cycle time -- the interval between detecting changes to assets or app code, launching a new Julia process, bringing the current HTTP.jl server down, precompiling code in the new process, and relaunching the HTTP.jl server -- is noticeably longer than for either Python or R.

In tests running a very simple sample app, it takes roughly 30-40 seconds to start the HTTP.jl process and see the following status message appear indicating that the server is ready:

Simple sample app
using Dash
using DashHtmlComponents

app = dash()
app.layout = html_div(id="outer-div") do
    html_div("Hello Julia!", id="page-content")
end

run_server(app, debug=true, dev_tools_hot_reload=true)
rpkyle$ julia /tmp/testapp/test_reload.jl 
[ Info: Running on http://127.0.0.1:8050

It can then take approximately 10-15 seconds upon making a change to the "Hello Julia!" string in the html_div for Julia + HTTP.jl + any other loaded packages to complete precompilation and finish restarting, and for the page to refresh. During this interval, the page/server are unresponsive:

rpkyle$ julia /tmp/testapp/test_reload.jl 
[ Info: Running on http://127.0.0.1:8050
[ Info: Running on http://127.0.0.1:8050

Improving startup time required to launch Julia or load packages is an active area of development in the language (see here or issues labeled as "latency" for background).

This issue is a placeholder for further discussion on this issue, and potential improvements to reduce the time required between page refreshes when "hard" (updates to non-CSS assets or code) reloads are performed.

@rpkyle rpkyle added the performance Issues related to Dash.jl performance label May 21, 2020
@rpkyle
Copy link
Contributor Author

rpkyle commented May 22, 2020

The revised implementation of hot reloading provided in 556f838 seems to have improved cycle times dramatically, it now takes 25-30% of the time (approximately 3 to 5 seconds) to "hard" reload as it did previously using the temporary module method. I'm comfortable closing this issue for now, since the feature seems reliable and relatively snappy for general use.

@rpkyle rpkyle closed this as completed May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues related to Dash.jl performance
Projects
None yet
Development

No branches or pull requests

1 participant