Overclock is an incredibly feature-rich, flexible, and user-friendly Python package designed for accelerating processes in Python. With Overclock, you can effortlessly speed up virtually any task by leveraging multi-threading capabilities.
-
Effortless Speed Boost: Overclock allows you to easily specify the number of threads you want and provides a simple interface to process any iterable using a user-defined function for mapping.
-
Custom Thread Metrics: Overclock includes a family of custom threads that track various metrics to provide insights into your processing. For example, the main pool's custom thread can monitor wait times, run times, average times, and total times per task. Another custom thread tracks memory management, task sizes, task results, and momentary system resource metrics.
-
Publisher Thread: The publisher thread keeps a running index to reorganize results back into order and asynchronously populates task queues. This ensures efficient processing and orderly result management.
-
Efficient Worker Threads: The main worker threads, which are part of the main pool, continuously listen for data from the queue and execute tasks until a kill signal is received.
To start using Overclock in your Python projects, follow these steps:
- Install Overclock via pip:
pip install overclock
- Import the necessary components into your Python script:
from overclock import Overclock
- Specify the number of threads and pass an iterable along with a mapping function:
pool = Overclock(num_threads=4)
results = pool.map(my_iterable, my_mapping_function)
For detailed documentation and examples, please refer to the project repository.
Overclock is licensed under the MIT License.