Skip to main content

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

Project description

Markdown

fasthardware Official Logo

# ⚡ 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.3.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.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasthardware-2.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 24c156e8541e39bacbc4b970744ebccf79d2f35c655ecae6237809a207e84636
MD5 9900cbf817d8b72a04ed5b6ace078f3a
BLAKE2b-256 5c6f7a4befc52fb9348e37841bf784f47e98a31de8cfc24271b6f18c895f7c28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasthardware-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b19c549d67db8e0afad6b0c6ac897232f9d7ac446fbaad671cd21723fb49f5d6
MD5 c29c97160dae3cd159e735df46453fe6
BLAKE2b-256 6eb26dc15ce02deef2fd77a415987c141bcd03c4e2ce14ac23bd86a29b730fcc

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