Best practices for reducing Android APK startup time and time-to-first-render #6643
fazi-gondal
started this conversation in
General
Replies: 1 comment
-
|
There is also the web version. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
@flet-dev Hi I am working on a Flet Android app named Vidsaver:
https://github.com/fazi-gondal/Vidsaver
It is a video downloader app using:
I have been trying to reduce production APK startup time on Android. The app-level startup has already been optimized so the Home screen is created before storage setup, permissions, downloader code, downloads library, video player, or media scanning are loaded.
Top-level imports in
main.pyare now intentionally minimal:The first visible page is added immediately:
Then app services are wired after first render. Heavier modules are imported only when the user actually needs them:
flet_permission_handleronly when storage permission is neededdownloader.pyonly when starting a download or scanning existing videoslibrary.pyonly when opening the downloads tabplayer.py/flet-videoonly when playing a saved videoEven with this, production startup is still slow on Android:
This makes me think most of the delay happens before my app code can render the Home page, possibly during Flutter/Flet/Python runtime initialization, package extraction, plugin registration, or dependency setup.
I would appreciate recommendations from the Flet community and maintainers:
flet-videoor other plugins add startup cost even if imported lazily from Python?yt-dlpbe handled differently for mobile apps?Build configuration:
Release build command:
The main goal is to improve perceived startup and ideally get time-to-first-render closer to 1-3 seconds on modern Android devices.
Any best practices, profiling advice, or packaging recommendations would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions