⚡ Optimize JSONL tail reading with streaming and collections.deque - #63
⚡ Optimize JSONL tail reading with streaming and collections.deque#63TKCen wants to merge 1 commit into
Conversation
Co-authored-by: TKCen <5960303+TKCen@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closing as a repeated automated proposal rather than adopting it into current main. These variants optimize physical JSONL lines or SQLite attachment behavior but change established logical-record, corruption-tolerance, read-only, or timeout semantics. Several also have unresolved correctness review findings. A future performance change should start from current main with focused regressions and a reproducible benchmark. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What:
Optimized
_read_plain_jsonl,_read_jsonl, and_read_inner_life_rowsindashboard/plugin_api.pyto stream large JSONL state files line-by-line and usecollections.dequewithmaxlento fetch only the requested tail/slice of rows, instead of reading the entire file as a single massive string viapath.read_text().splitlines().🎯 Why:
Using
read_text().splitlines()before slicing reads the entire file contents into memory and allocates massive list structures, leading to severe CPU overhead and memory footprint (especially for large JSONL databases such as signals/inbox.jsonl containing 100k+ rows).📊 Measured Improvement:
Using the self-created benchmark tool on a 100k-row JSONL dataset:
limit = 5000:limit = 12:PR created automatically by Jules for task 5266741715217991536 started by @TKCen