[Python subprocess/psutil: 15년 묵은 Busy-loop 폴링을 끝내고 진정한 이벤트 기반 대기로 전환
Python의 subprocess 모듈과 psutil 라이브러리가 15년 동안 사용해온 비효율적인 'Busy-loop 폴링' 방식을 이벤트 기반 대기(Event-driven waiting)로 개선하여 CPU 사용량과 지연 시간을 줄이고 확장성을 향상시켰습니다.
[Python subprocess/psutil: 15년 묵은 Busy-loop 폴링을 끝내고 진정한 이벤트 기반 대기로 전환
Python의 subprocess 모듈과 psutil 라이브러리가 15년 동안 사용해온 비효율적인 'Busy-loop 폴링' 방식을 이벤트 기반 대기(Event-driven waiting)로 개선하여 CPU 사용량과 지연 시간을 줄이고 확장성을 향상시켰습니다.
Detect memory leaks of C extensions with psutil and psleak
https://gmpy.dev/blog/2025/psutil-heap-introspection-apis
#HackerNews #DetectMemoryLeaks #psutil #psleak #CExtensions #MemoryManagement #TechNews
Wheels for free-threaded Python now available for psutil
https://gmpy.dev/blog/2025/wheels-for-free-threaded-python-now-available-in-psutil
#HackerNews #Wheels #psutil #Python #FreeThreaded #Development #OpenSource
I want to measure run time of a Python program and compare it to /usr/bin/time. The script, t.py:
import psutil, time,
startSecs = psutil.Process(os.getpid()).create_time()
print("startup took %.3fs" % (time.time() - startSecs))
run as:
/usr/bin/time -f 'wall=%e' python3 t.py
output:
startup took 0.822s
wall=0.03
where 0.8s is quite obviously wrong, not only because of the wall=0.03, but because there is no noticeable wait of nearly a second. How come?
Introduction to psutil: A Python library for system monitoring and automation
https://www.recursiveneuron.com/2022/12/introduction-to-psutil-python-library.html
#psutil #python #programming #pythonlesson #pythontips #Python3