-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Optimizing startup time #37
Comments
I'm having trouble reproducing your result. The following code measures the time from starting the script until the UI is running. Independent of whether LinePlot and Plot are imported in import time
t = time.time()
from nicegui import ui
ui.label('Hello world!')
ui.on_startup(lambda: print(f'{time.time() - t:.3f}'))
ui.run(port=1234) |
I'll try to run your code, but I think MacBook is much more powerful than Beaglebone Black, so maybe it's not noticeable there. |
With commented imports:
With uncommented imports:
In my research, I ran python interpreter with |
Ok, we checked the timing on a Jetson Nano and got 4.0 seconds each. The large difference might be caused by the little RAM you have available on the Beaglebone Black. Nevertheless, we will shortly implement feature flags for things like Matplotlib, Highcharts, AG Grid and Three.js. |
Ok, it is finally released as v0.7.29 |
It would be nice to conditionally omit imports of LinePlot and Plot classes. Doing so brought the startup time on Beaglebone Black single board computer from 20+ to 8 seconds.
Another similar thing is justpy importing its chartcomponents.py inside, but perhaps this is an issue for their own repository.
The text was updated successfully, but these errors were encountered: