KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
fastprocess
★ 9
Open GitHub ↗
A fast subprocess library
Download README (.md)
Explore Similar Repositories
MOZ-s-Particles
:
a cheap prefab for vrchat
hsu.ai
:
Harbour.Space University AI course
dog_breed_retrival
:
A project aimed to classify dog breeds and search for the most matched image in the database
openeo-vue-components
:
Common Vue components for openEO.
Home-Power-Monitor
:
esp8266 sct-013
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
fastprocess
?
Download (.md)
# 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 --------------------------------------------------- ```