Skip to content

[codex] Optimize global graph key hashing#3

Merged
shinaoka merged 1 commit into
mainfrom
codex/global-op-key-fingerprint
May 19, 2026
Merged

[codex] Optimize global graph key hashing#3
shinaoka merged 1 commit into
mainfrom
codex/global-op-key-fingerprint

Conversation

@shinaoka
Copy link
Copy Markdown
Member

Summary

  • Cache a structural fingerprint inside GlobalOpKey so derived value hashing no longer recursively walks the full input tree on every hash.
  • Store derived value producers behind Arc<GlobalOpKey> so sibling outputs share the same precomputed operation key.
  • Keep collision correctness by using the fingerprint as a prefilter while PartialEq still compares the full structure.

Impact

This reduces fixed overhead in graph materialization/interner hot paths without changing graph identity semantics. Downstream constructors need to use GlobalOpKey::new and wrap derived producers in Arc.

Validation

  • cargo fmt --all
  • cargo clippy --workspace
  • cargo test --release
  • cargo test --doc --release

@shinaoka shinaoka merged commit c20e891 into main May 19, 2026
3 checks passed
@shinaoka shinaoka deleted the codex/global-op-key-fingerprint branch May 19, 2026 02:08
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