Skip to content

v0.4.5

Choose a tag to compare

@github-actions github-actions released this 28 Aug 04:50
· 88 commits to main since this release

jupynvim v0.4.5

Big notebooks stay responsive.

Stored output no longer freezes the editor

A notebook whose cell holds the output of something like !tree over a dataset directory could peg the editor at ~99% CPU with the main loop starved. Measured on a 2.1 MB notebook of 124 cells, one of which stores a 420 KB listing of 12002 files: 2535 full document rebuilds during 74 seconds of idle time, 97% of wall clock, and the command line never accepted input. Typing three characters cost 5.9 seconds. A single keystroke took 7.6 seconds to echo. The worst stall was 19.7 seconds.

Outputs render as real buffer lines, and the renderer walked the entire stored text through carriage-return and ANSI processing on every call, dozens of times per keystroke because the diagnostic and didChange paths each triggered it. Neither pass changes the line count, so the lines actually shown are now sliced out first and only those are processed, and the result is cached per cell on a content-derived key. Diagnostics also resolved a cell's start line once per diagnostic, each resolution rebuilding the whole document; that is hoisted to once per publish.

Rebuild cost went from 27 ms to 0.62 ms, and 20 seconds of idle went from 2535 rebuilds to one.

Two symptoms that looked unrelated came from the same freeze: a keypress queued during a multi-second stall replays into a duplicate file explorer, and that duplicate drives cmdheight up, leaving a dead region at the bottom of the screen. Both go away with the stall.

Output is capped, and you can tune it

max_output_lines bounds how many lines of a cell's output are rendered, default 500. Set it to 0 to disable. Both ends are kept, so a training log still shows its final epochs, with a marker in between telling you how many lines are hidden. <leader>no expands or re-collapses the cell under the cursor.

This is display only. The .ipynb keeps every line and saving is lossless.

Full Changelog: v0.4.4...v0.4.5