Skip to content

Speed up frackture_hashing and surface fast-path hashing paths - #26

Draft
cto-new[bot] wants to merge 1 commit into
mainfrom
speed-up-frackture-hashing-profile-fast-paths-sha256-reuse
Draft

Speed up frackture_hashing and surface fast-path hashing paths#26
cto-new[bot] wants to merge 1 commit into
mainfrom
speed-up-frackture-hashing-profile-fast-paths-sha256-reuse

Conversation

@cto-new

@cto-new cto-new Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Summary

Speed up the Frackture hashing path and surface fast-paths for deterministic hashing.

Details

  • Reuse a sha256 object per call to reduce constructor overhead and maintain salting
  • Add fast-paths for FrackturePayload, buffer protocol inputs, and large byte sequences using memoryview
  • Introduce streaming normalization for dict/list inputs to minimize copies
  • Regression tests cover FrackturePayload, memoryview, and nested dict to ensure canonical digests
  • Benchmarks now record SHA256 and Frackture hash latencies and a new ratio metric for progress
  • Update insights/template to document the new metric

- reuse a single hashlib.sha256 per call via .copy() to reduce constructor overhead
- implement fast-paths: FrackturePayload (.to_bytes()), buffer protocol inputs, and large byte sequences via memoryview to avoid copies
- preserve salting behavior while enabling efficient hashing of large/dict inputs with streaming normalization
- add regression tests for fast paths (FrackturePayload, memoryview, nested dict) to ensure canonical SHA256 matches normalized bytes
- extend benchmarks to record SHA256 and Frackture hash latencies and compute ratio; update docs template for new metric
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.

0 participants