diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 10:50:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 048e81e3471c73b9ac690901819976f689f6a4ce (patch) | |
| tree | f2872bb0d64c25ff83c779785abe4119ff389ff6 /src/builtins.zig | |
| parent | a0ce72b3d02e836439cac52e8074f569a6b4ae85 (diff) | |
| download | pardes-048e81e3471c73b9ac690901819976f689f6a4ce.tar.gz pardes-048e81e3471c73b9ac690901819976f689f6a4ce.zip | |
An append to a body through 9P costs its own bytes, not five passes over the whole body: 60 KB appends go from 35.7 to 2.1 ms each
Round 25 measured bulk body writes at about 8 ms a write. There is no frame wait in it: a profile of open, write, clunk in a loop found the flush of each close walking the whole body five times. dotOf, setDot and showOffset turned the cursor between offsets and rows by counting every newline from the top; setContent found the line index's changed span by comparing old and new byte for byte, and hashed the new text to see whether it was back to the saved one. The rows now come from the file's line index by binary search (checked against the counting at every offset), a splice tells setContent the span it changed, and the text is hashed only when its length is the saved text's. Measured over 9P on a Debug build: 60 KB appends 35.7 to 2.1 ms, 8 KB 5.3 to 0.8 ms, 1 KB 1.3 to 0.9 ms. What is left is two copies of the text an edit (the splice's and the undo snapshot's). The perf gate gains body-appends, 64 appends of 8 KB on the 50k-line file, and its three baselines are recorded again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
0 files changed, 0 insertions, 0 deletions
