----------------------
This module tries to improve the start-up time of Python scripts. It
does so by doing two things:
- Eliminating the time it takes to spawn a new Python process.
- Loading modules ahead of time.
Eliminating interpreter start-up time is done by maintaining a pool of
Python processes. Reducing module load times is done by importing
modules immediately after a worker is spawned. Python is smart about
not re-importing modules that are already in ``sys.modules``.
I ended up writing this module because of a few small Qt programs that
weren't launching as fast as I would like them too. The results were a
~100ms reduction in startup time, which can be attributed to PySide
being a hefty package to import.
There are plenty of bugs and todos left - handling return code and
proper process shutdown seem to be on top of the list.
Usage
=====
::
Usage: python-module-launcher-3.3 [-hvdpws] socket [mod, ...]
Options:
-h, --help show this help message and exit
-v, --version show version and exit
-d, --daemonize run in background (default: no)
-p, --pidfile pid file to use if running as a daemon
-w, --workers <num> worker processes to start (default: 5)
-s, --spare <num> spare worker processes to maintain (default: 3)
Arguments:
socket path to AF_UNIX socket
mod* modules to pre-import in workers
Examples:
python-module-launcher-3.3 launcher.sock numpy PySide.QtCore
echo -n "module path.to.module" | nc -U launcher.sock
echo -n "file path/to/script.py arg1 arg2 | nc -U launcher.sock
echo -n "entrypoint name==0.1.0 console_scripts name arg1 arg2"
You can send the following commands to the unix socket::
file path/to/script.py arg1 arg2 ...
module path.to.module arg1 arg2 ...
entrypoint name==0.1.0 console_scripts name arg1 arg2 ...
License
=======
This module is released under the terms of the `Revised BSD License`_.
Metadata
Release files for module-launcher 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| module-launcher-0.2.0.tar.gz | 4.5 kB | Without provenance | Details |
Release files / module-launcher-0.2.0.tar.gz
| Download URL | module-launcher-0.2.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cb2d3c5db6e9476da8795a18cd7b1a6d78872190b415f54f5f7d9574b2ea986
|
|
BLAKE2b-256 checksum How to use checksums |
6f589681d8e46600d143453614b114afcc9549c9755e0f369010106dbed20c3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for module-launcher 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.