Skip to content

v0.2.0 — Performance & Python 3.11+

Latest

Choose a tag to compare

@slima4 slima4 released this 28 Mar 07:55
· 15 commits to main since this release

What's New

Performance (5x faster)

  • Parallel corpus generation — rules generate strings concurrently across all CPU cores
  • Fork-based evaluation on Linux — workers inherit pre-compiled patterns via copy-on-write, eliminating serialization and recompilation overhead
  • ~8s for 1,537 rules (down from ~38s)
  • Spawn-based fallback on macOS/Windows

Optional RE2 acceleration

pip install crossfire-rules[re2]

Tries google-re2 first for 10-100x faster regex compilation, falls back to stdlib re for PCRE-only patterns (backreferences, lookahead). Works transparently with fork-based workers.

Python 3.11+ minimum

  • Dropped Python 3.10 support
  • StrEnum, datetime.UTC, tomllib (no tomli fallback)

Other improvements

  • CROSSFIRE_WORKERS environment variable for worker count
  • deque for BFS clustering (O(1) popleft vs O(n) pop(0))
  • Early skip for zero-overlap pairs in classifier
  • lru_cache on _pattern_complexity
  • diff_corpora reuses evaluate_corpus (no redundant O(R×C) scan)
  • Direct gen_duration timing instead of subtraction
  • Worker failures raise RuntimeError instead of being silently swallowed
  • CompiledPattern Protocol for type-safe re/re2 dual support
  • mypy --strict enforced in CI
  • README badges (CI, PyPI, Python, license)

Install / Upgrade

pip install --upgrade crossfire-rules

Full Changelog

v0.1.0...v0.2.0