From c27e04c88557716bbe8e42b9174ba9b07f90facf Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 8 Oct 2026 01:27:58 +0200 Subject: perf(node): sample 9 MB with the size above 9 MB, keep known ids hash_version 3: size + first 4 MB + last 4 MB + 1 MB at the middle, 5.5x faster cold on a USB disk than the 45 MB sample. The cache now serves a hit under whatever version it holds, so no existing id moves. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-common/src/meshbay_common/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/meshbay-common') diff --git a/packages/meshbay-common/src/meshbay_common/protocol.py b/packages/meshbay-common/src/meshbay_common/protocol.py index f8e56ec..c048b8d 100644 --- a/packages/meshbay-common/src/meshbay_common/protocol.py +++ b/packages/meshbay-common/src/meshbay_common/protocol.py @@ -281,7 +281,7 @@ class IndexEntry: track_no: int | None = None # tag or parsed, Music app taken_at: int | None = None # unix timestamp, EXIF DateTimeOriginal — Photos app camera: str | None = None # "Make Model", when both present — Photos app - hash_version: int = 1 # 1 = full-file blake3, 2 = partial-read (45 MB sample) + hash_version: int = 1 # 1 = full-file blake3, 2 = 45 MB sample, 3 = size + 9 MB sample def index_entry_wire(e: IndexEntry) -> dict: -- cgit v1.2.3