A fast subprocess library
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
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
---------------------------------------------------
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastprocess-2.1.1.tar.gz.
File metadata
- Download URL: fastprocess-2.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c82ffb1394ebd65c600eae0c2c7efdef96689d7b3f92c99ff4747553ef1a856
|
|
| MD5 |
fe652060a2ce53e50efb8eaca82590c3
|
|
| BLAKE2b-256 |
e916669ea44541d91487d8bc49b9e970f5a03652b4277bc2b55e67bc2143dd27
|
File details
Details for the file fastprocess-2.1.1-py3-none-any.whl.
File metadata
- Download URL: fastprocess-2.1.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f276e63f0117e409ee99c908e5032da065ac48c6f3bad51a562e083d65b4f9
|
|
| MD5 |
d4acc5aaa21a4e0052e7fb1f9283b135
|
|
| BLAKE2b-256 |
7c41575ec2f84ae4ae2b28bd6baf6ab606bf6e44c0964df5918b981d85736182
|