-
Notifications
You must be signed in to change notification settings - Fork 0
Batch embed_text trigram hashing (37-78% of parse_bundle time) #90
Copy link
Copy link
Closed
Labels
area:snapshotSnapshot v2 directory format, portability, replaySnapshot v2 directory format, portability, replayenhancementNew feature or requestNew feature or requestpriority:p2Do after evidence or dependency gates; optional portability capabilityDo after evidence or dependency gates; optional portability capabilityv0.2.NEXTCommitted for a future 0.2.x release; not yet pinned to 0.2.4/0.2.5Committed for a future 0.2.x release; not yet pinned to 0.2.4/0.2.5v0.2.xHotMem post-v0.2 follow-up workHotMem post-v0.2 follow-up work
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area:snapshotSnapshot v2 directory format, portability, replaySnapshot v2 directory format, portability, replayenhancementNew feature or requestNew feature or requestpriority:p2Do after evidence or dependency gates; optional portability capabilityDo after evidence or dependency gates; optional portability capabilityv0.2.NEXTCommitted for a future 0.2.x release; not yet pinned to 0.2.4/0.2.5Committed for a future 0.2.x release; not yet pinned to 0.2.4/0.2.5v0.2.xHotMem post-v0.2 follow-up workHotMem post-v0.2 follow-up work
Summary
Batch the per-trigram hashing in
embed_text— it dominates bundle parse time.Measured impact (spike #48, PR #84, B3)
embed_textis 37–78% ofparse_bundlewall time across bundle trees (100–2500 bundles). It issues onehashlib.md5call per character trigram (src/hotmem/embed.py:44). A native markdown/parse helper would optimize the wrong 20%; the lever is here.Proposal
Batch trigram hashing (single
hashlibupdate over a packed buffer, or a cheaper rolling hash), keepinghotmem-hash-v1embedding semantics bit-compatible — otherwise version the embedding model string.Acceptance criteria
hotmem-hash-v1vectors unchanged (or model string versioned + migration noted).Context
Spike recommendation follow-up #5:
bench/native_spike/README.md. Related: #48, #49.