dsh-session-repacker: Repacks DSH session logs into the official two-frame format, opening old sessions about 6 times faster.

# Preface If you have used DSH for long sessions, you have likely encountered this issue: opening an old session takes several seconds to respond. The problem lies in the storage layer. DSH's JSONL session backend compresses each batch write into a standalone zstd frame and appends it to the file's tail. A long session can easily contain tens of thousands of frames; reading requires decompressing frame by frame. Furthermore, the backend does not support seek-based suffix reading, meaning the entire file must be decoded whether you need just the tail or the whole thing. The number of frames is determined by historical writes and cannot be shrunk afterward. `kkishapppy/dsh-session-repacker` addresses this issue by repacking scattered thousands of log frames into the official native format. Measured results show the maximum time to open a session reduced from approximately 661ms to approximately 126ms.

Read More