Skip to content

Cache CIDv1.buffer after first access - #87

Merged
acul71 merged 1 commit into
masterfrom
fix/cache-cidv1-buffer
Sep 7, 2026
Merged

acul71 merged 1 commit into
masterfrom
fix/cache-cidv1-buffer

Conversation

@acul71

@acul71 acul71 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cache CIDv1.buffer on first access so repeated serialization does not recompute bytes (multicodec.add_prefix + join).
  • Add regression test that repeated .buffer access returns the same object.
  • Add 70.performance.rst newsfragment.

Fixes #70

Test plan

  • make validate-newsfragments
  • make check-docs-ci
  • make pr (lint, typecheck, pytest — 192 passed)
  • GitHub Actions tox + windows green before squash-merge

Made with Cursor

Avoid recomputing the byte representation on every encode/to_bytes/key_string call.

Co-authored-by: Cursor <cursoragent@cursor.com>
@acul71
acul71 merged commit 48bef6c into master Sep 7, 2026
24 checks passed
@acul71
acul71 deleted the fix/cache-cidv1-buffer branch September 7, 2026 19:20
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.

CIDv1.buffer property recomputes on every access

1 participant