A Python package for caching function results on disk and running embarrassingly parallel workloads with minimal code changes.
Overview
Joblib helps Python programs run faster by memoizing expensive function calls to disk and by parallelizing loops across processes or threads. It is designed so application logic and control flow stay familiar while caching and parallelism are added through provided APIs.
The Memory interface stores compressed pickles of return values and supports efficient serialization of NumPy arrays when NumPy is present, without requiring NumPy as a hard dependency. Parallel coordinates worker pools using a vendored loky backend and optional integrations such as Dask for distributed backends.
Optional extras include faster compression via python-lz4 and psutil to reduce memory leaks in worker processes. Documentation covers parallel backends, custom backends, serialization behavior, and connection pooling patterns for long-running jobs.
Install is via pip; the package supports current Python 3 releases noted in the project materials and is widely used as infrastructure beneath scientific and machine-learning stacks.
Key features
- Disk-based function memoization
- Embarrassingly parallel Parallel helper
- NumPy-aware efficient serialization
- Vendored loky process backend
- Optional Dask distributed backend
- Optional lz4 compression
- Optional psutil memory safeguards
- Minimal changes to existing code
Use cases
- Cache heavy Python function outputs
- Parallelize parameter sweeps
- Speed up sklearn-style pipelines
- Persist intermediate scientific results
- Scale loops across CPU cores