# fast-croniter (v0.2.0) > Up to 207x Faster Drop-in Rust Cron Engine for Python with PyO3 abi3 bindings. ## Overview fast-croniter is an open-source, high-performance drop-in replacement for Python's `croniter` library. Written in Rust with native PyO3 abi3 bindings, it passes 100% of the 267 reference test fixtures from `kiorky/croniter` with 0.00% output drift, while delivering up to 207.4x speedups and peak single-step throughput of 6,313,929 ops/sec. ## Key Capabilities - **Throughput**: Up to 6,313,929 ops/sec single-step (vs 34,220 ops/sec in pure Python `croniter`). - **Speedup**: 20x to 207.4x faster across all recurrence, datetime instantiation, and syntax validation workflows. - **Latency**: P50 latency of 32 ns; P99 tail latency under 58 ns (vs 3,890 ns in CPython). - **Memory**: Zero heap allocations per step evaluation (`0 bytes` heap delta via stack-allocated `SmallVec` and 64-bit integer bitmasks, plus non-allocating candidate overrides). - **Concurrency**: Releases the Python Global Interpreter Lock (GIL) during range sweeps and batch evaluations, eliminating scheduler lock contention across Apache Airflow, Celery Beat, Temporal, and FastAPI worker processes. - **Typing & IDE**: Complete PEP 561 `@overload` type stubs in `fast_croniter/__init__.pyi` providing precise static return types for `datetime` and `float` return kinds in Pyright, Mypy, and IDE autocompletion. - **Compatibility**: PyO3 `cp38-abi3` pre-compiled wheels for Linux (x86_64, aarch64, musl), macOS (Apple Silicon arm64, Intel x86_64), and Windows (x86_64, ARM64) targeting CPython 3.8–3.13, plus source `sdist`. - **Syntax Support**: Full standard 5-field POSIX, 6-field second-extended cron expressions (`second_at_beginning=False` by default, trailing-second order), hashed jitter (`H`/`R`), nearest weekday (`W`), nth weekday of month (`#`), last boundary (`L`), and Vixie/ISC bug emulation. ## Installation ```bash pip install fast-croniter # or uv add fast-croniter ``` ## Quick Start ```python from fast_croniter import croniter, croniter_range import datetime base = datetime.datetime(2026, 1, 1, 0, 0) iter = croniter("*/5 * * * *", base) # Get next recurrence as datetime (type inferred as datetime.datetime) next_dt = iter.get_next(datetime.datetime) # Returns: 2026-01-01 00:05:00 # Get next recurrence as Unix timestamp float (type inferred as float) next_ts = iter.get_next(float) # Returns: 1767225900.0 (in ~158 nanoseconds) # Bounded range generator (ret_type=None infers return type from start/stop) for dt in croniter_range(base, datetime.datetime(2026, 1, 2), expr_format="*/5 * * * *", ret_type=None): pass ``` ## Airflow & Celery Monkeypatch ```python import sys import fast_croniter sys.modules['croniter'] = fast_croniter ``` ## Links & Sources - GitHub Repository: https://github.com/AkashPriyadarshii/fast-croniter - PyPI Package: https://pypi.org/project/fast-croniter/ - Author: Akash Priyadarshi (https://akashpriyadarshi.is-a.dev) - License: Apache-2.0 / MIT Dual License