This project has been archived by its maintainers, and is no longer receiving any updates.
Fastprocess
A fast subprocess library
[!NOTE] This library is no longer maintained.
Modern versions of subprocess are very close to as fast as this library, so just use that :)
Usage
Spawning a process with fastprocess is very easy
In [1]: from fastprocess import FastProcess
In [2]: pid = FastProcess(['echo', 'hello', 'world'])
hello world
In [3]: pid.wait()
Out[3]: 0
You can redirect io using the stdin, stdout, and stderr options
In [4]: null = open('/dev/null', 'w')
In [5]: pid = FastProcess(['yes'], stdout=null)
In [6]: pid.terminate()
FastProcess methods
terminate():
Sends SIGTERM to the process
kill(sig):
Sends signal 'sig' to the process
wait():
Waits for the process to exit then returns the exit code
Performance
Here are the results of running ./benchmark/bench
---------------------------------------------------
10000 spawns with fork and exec...
real 0m2.157s
user 0m0.048s
sys 0m2.104s
---------------------------------------------------
10000 spawns with fastprocess...
real 0m2.598s
user 0m1.225s
sys 0m0.356s
---------------------------------------------------
10000 spawns with subprocess...
real 0m12.211s
user 0m7.832s
sys 0m9.072s
---------------------------------------------------
Metadata
Release files for fastprocess 2.1.1
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 | Actions |
|---|---|---|---|---|
| fastprocess-2.1.1.tar.gz | 4.7 kB | Without provenance | Details for fastprocess-2.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastprocess-2.1.1-py3-none-any.whl | Python 3 | none | any | Details for fastprocess-2.1.1-py3-none-any.whl |
Total release size: 9.9 kB
Release files / fastprocess-2.1.1.tar.gz
| Download URL | fastprocess-2.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c82ffb1394ebd65c600eae0c2c7efdef96689d7b3f92c99ff4747553ef1a856
|
|
BLAKE2b-256 checksum How to use checksums |
e916669ea44541d91487d8bc49b9e970f5a03652b4277bc2b55e67bc2143dd27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / fastprocess-2.1.1-py3-none-any.whl
| Download URL | fastprocess-2.1.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91f276e63f0117e409ee99c908e5032da065ac48c6f3bad51a562e083d65b4f9
|
|
BLAKE2b-256 checksum How to use checksums |
7c41575ec2f84ae4ae2b28bd6baf6ab606bf6e44c0964df5918b981d85736182
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for fastprocess 2.1.1
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.