Skip to content

feat: add streaming mode for prefix analysis (constant memory)#64

Merged
HDT3213 merged 3 commits intoHDT3213:masterfrom
ishakuta:feat/streaming-prefix
Apr 18, 2026
Merged

feat: add streaming mode for prefix analysis (constant memory)#64
HDT3213 merged 3 commits intoHDT3213:masterfrom
ishakuta:feat/streaming-prefix

Conversation

@ishakuta
Copy link
Copy Markdown
Contributor

@ishakuta ishakuta commented Mar 23, 2026

The existing prefix command builds a full radix tree in memory, which OOMs on large RDB files. This adds a -streaming flag that uses a flat map[prefix]stats instead, keeping memory usage constant regardless of dump size.

Usage: rdb -c prefix -streaming -max-depth 3 -prefix-sep ":" dump.rdb

Result: 132M keys / 55GB RDB parsed with ~87MB total memory

ishakuta and others added 3 commits March 23, 2026 20:58
The existing prefix command builds a full radix tree in memory,
which OOMs on large RDB files. This adds a -streaming flag that
uses a flat map[prefix]stats instead, keeping memory usage constant
regardless of dump size.

Usage: rdb -c prefix -streaming -max-depth 3 -prefix-sep ":" dump.rdb
- Only emit prefix entries where depth < segment count, preventing
  full keys from being stored as individual "prefixes" (23M -> 2.5K entries)
- Add -track-mem flag to print heap/sys stats to stderr every 1M keys
- Result: 132M keys / 55GB RDB parsed with ~87MB total memory
@HDT3213 HDT3213 merged commit 8d16bb1 into HDT3213:master Apr 18, 2026
2 checks passed
@ishakuta ishakuta deleted the feat/streaming-prefix branch April 18, 2026 18:33
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.

2 participants