Skip to content

Release 0.4.2: tag-index invalidation perf, Redis TTL pushdown, invalidate CLI#7

Merged
jolovicdev merged 7 commits into
masterfrom
0.4.2
May 1, 2026
Merged

Release 0.4.2: tag-index invalidation perf, Redis TTL pushdown, invalidate CLI#7
jolovicdev merged 7 commits into
masterfrom
0.4.2

Conversation

@jolovicdev
Copy link
Copy Markdown
Owner

Summary

  • Perf: delete_by_tags in SQLite batches all matching rows into a single DELETE with one orphan-detection pass — previously O(n) row-by-row _delete_commit_body calls with per-row orphan queries.
  • Perf: delete_by_tags in Redis now uses tag-set indexes (cashet:tag:{key}, cashet:tag:{key}:{value}) with SINTER — previously a full zrevrange(all) scan fetching every commit.
  • Perf: find_by_fingerprint in Redis pushes TTL filtering server-side via ZREVRANGEBYSCORE using expires_at timestamp as the sorted-set score — previously Python-iterated all candidates checking expires_at client-side.
  • Feat: cashet invalidate -t key=value / -t key CLI command.
  • Test: replaced time.sleep with freezegun in 3 TTL/GC tests for deterministic execution.
  • Test: added Redis delete_by_tags coverage (exact match, bare key, multi-condition) and CLI invalidate tests.

Test plan

  • uv run ruff check src/ tests/ && uv run pyright src/
  • uv run pytest tests/ -v (339 passed)
  • Smoke: pip install ., cashet invalidate -t key=value works

@jolovicdev jolovicdev merged commit ca7a730 into master May 1, 2026
0 of 3 checks passed
@jolovicdev jolovicdev deleted the 0.4.2 branch May 1, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant