kolibri
kolibri copied to clipboard
Startup time improvements
Summary
- Limit imports of pkg_resources to defer a costly import
- Move code out of module scope and into the core app ready method
- Defer actual registration of zeroconf to the
RUNevent so that it doesn't blockSERVING - Default the
no_inputkwarg of initialize toTrue- this will not effect cli invocations that provide their own default value, but will help apps that are calling theinitializefunction and which are running inno_inputcontexts.
In all, these changes seemed to give approximately a 60-70% reduction in time taken from first start to being ready to serve HTTP requests.
Testing checklist
- [x] Contributor has fully tested the PR manually
- [ ] If there are any front-end changes, before/after screenshots are included
- [ ] Critical user journeys are covered by Gherkin stories
- [x] Critical and brittle code paths are covered by unit tests
PR process
- [x] PR has the correct target branch and milestone
- [x] PR has 'needs review' or 'work-in-progress' label
- [x] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
- [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label
- [ ] If this includes an internal dependency change, a link to the diff is provided
Reviewer checklist
- Automated test coverage is satisfactory
- PR is fully functional
- PR has been tested for accessibility regressions
- External dependency files were updated if necessary (
yarnandpip) - Documentation is updated
- Contributor is in AUTHORS.md
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-0.16.0.dev0_git.20220924000318.pex |
| Unsigned Windows installer | kolibri-0.16.0.dev0+git.20220924000318-unsigned.exe |
| Debian Package | kolibri_0.16.0.dev0+git.20220924000318-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.16.0.dev0+git.20220924000318-0.3.0.dmg |
| Source Tarball | kolibri-0.16.0.dev0+git.20220924000318.tar.gz |
| WHL file | kolibri-0.16.0.dev0+git.20220924000318-py2.py3-none-any.whl |
Irritatingly, a change in here seems to be breaking the Mac App build. Will investigate further before we merge this.
DMG build failure appears to be unrelated to these changes. Tracked separately: https://github.com/learningequality/kolibri-app/issues/105