Improve startup time by running from snapshots #4
kasperl
started this conversation in
Show and tell
Replies: 1 comment
-
Using snapshots makes Toit run tiny scripts more than 10x faster than Python 3. /usr/bin/time -lp build/host/bin/toitvm hello.snapshot shows:
We can compare this to Python 3.9.5's: /usr/bin/time -lp python3 __pycache__/hello.cpython-39.opt-1.pyc which gives this output:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Did you know that you can run apps from snapshots instead of directly from source code? On the ESP32, applications written in Toit are always bundled as precompiled images, but on Linux it is possible to get some of the same benefits using snapshots.
Instead of running an example directly like this:
you can generate an intermediate snapshot and run that with the following commands:
Snapshots are faster to start from and on my machine they make running
examples/hello.toit
around 200 milliseconds faster; practically instantaneous!Beta Was this translation helpful? Give feedback.
All reactions