Skip to main content

Maximize the absolute computing power of your Python process with a single line of code.

Project description

Markdown

⚡ fasthardware

PyPI version Downloads License: MIT

Maximize the absolute computing power of your Python process and all its child processes with just a single line of code.

fasthardware is a lightweight, zero-configuration hardware acceleration injector designed for high-performance, real-time Python applications (e.g., YOLO object detection, MediaPipe pose estimation, OpenCV video pipelines, and heavy distributed inference loops).

By hijacking the OS scheduler, managing runtime memory thresholds, and forcing strict CPU core binding across multi-processes, fasthardware eliminates micro-stuttering and stabilizes frames under heavy loads.


🚀 Key Features

  • OS Priority Escalation: Automatically forces the host OS (Windows/Linux) to allocate maximum CPU scheduling priority to your Python process.
  • 🔥 ULTIMATE Multi-Process Interception: Automatically tracks all spawned child processes, forces them into high-priority classes, and binds them to dedicated CPU cores (CPU Affinity) to eliminate distributed bottlenecks.
  • Micro-Stuttering Elimination: Optimizes Python's Garbage Collection (GC) thresholds to prevent "Stop-the-World" latency spikes during heavy loops.
  • C-Level Multicore Mobilization: Injects global environment flags (OMP, MKL, OPENBLAS, NUMEXPR) to force underlying C/C++ backed libraries (NumPy, OpenCV) to utilize every single logical core available.
  • Zero-Config Integration: No code rewrites. Just import it at the very top of your script.

📦 Installation

Install the package directly from PyPI:

pip install fasthardware

🛠️ Quick Start

  1. Default Mode (Single Process Boost) Perfect for standard loops like standalone YOLO inference or single-camera stream pipelines.
from fasthardware import fasthardware

Unlock maximum priority for the current process

fasthardware.speedup()

Your heavy real-time loop goes here...

  1. ULTIMATE Mode (Multi-Process & Distributed Boost) Designed for massive pipelines that spawn child processes (e.g., multi-GPU frameworks, distributed learning, parallel workers). It intercepts all child processes and binds them to specific cores.
from fasthardware import fasthardware

Supercharge both main and all child processes recursively

fasthardware.speedup(mode="ULTIMATE")

Your heavy multiprocessing/distributed pipeline here...

🧹 Manual Memory Sweeping (Optional) For ultra-heavy asynchronous pipelines (e.g., blending AI inference with async API requests or audio generation), manually sweep the 0-generation memory cache without breaking your frame rate:

# Call this at the end of your loop iteration if necessary
fasthardware.manual_sweep()

📊 Performance Impact Actual benchmarking on heavy real-time pipelines (YOLOv8 Inference + Parallel Workers):

Standard Python Implementation: ~30 FPS (with frequent micro-stutters and core thrashing)

With fasthardware (ULTIMATE Mode): 53+ FPS (Stable, zero core competition, 40%+ performance jump)

📜 License This project is licensed under the MIT License - see the LICENSE file for details.

Developed with ⚡ by Choi Woongyo.

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

fasthardware-2.0.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasthardware-2.0.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file fasthardware-2.0.2.tar.gz.

File metadata

  • Download URL: fasthardware-2.0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for fasthardware-2.0.2.tar.gz
Algorithm Hash digest
SHA256 87bd909cb1235fab48ec60f1712c09e553f0c3ebeb77a25bf443b08111c35896
MD5 3496a5722f672a3c34a4f5e61a974b82
BLAKE2b-256 e0dda68d613b2ff1b315abb0ba5d1c8079c01828a8617be4ab0a0ef22bc3452c

See more details on using hashes here.

File details

Details for the file fasthardware-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: fasthardware-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for fasthardware-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a51ac866fbe676674736b7b003a6eb0eeb566512181b33993b621853d2703dd1
MD5 b20f9523c8f6cfb2afd72ed881ef6ffa
BLAKE2b-256 7380d305289f44dc8896cc3cb6615efbbc24ab40e966be1b5e594e27738287ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page