summaryrefslogtreecommitdiff
path: root/core/edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 15:42:33 -0300
committerGabriel Schneider <[email protected]>2026-11-23 16:31:13 -0300
commit6f9a8b907a504c28aef6c68b923508419b54f0ee (patch)
tree4a9411cf4caffb6b7886f52dd67392a623915338 /core/edit.zig
parentfa3550eedec44e624384b478fc19a40d94fb7a82 (diff)
downloadpardes-6f9a8b907a504c28aef6c68b923508419b54f0ee.tar.gz
pardes-6f9a8b907a504c28aef6c68b923508419b54f0ee.zip
changes layer: a file with no layer pays for it what tree6 paid, found by measure (instructions by symbol and by source line, Intel PT, on the ReleaseFast pardes-perf, tree6 against round 9's base): perfops against tree6 from 12 of 121 over 0.1% to 1 (the base's `body-appends` +0.44%, `open` +0.235%, `client-key-down` +0.13..0.16%, `client-delete-undo`, `client-edit-char`, `deep-sel` +0.10..0.14%, every frame +3.8k); (1) `File.fillBody`'s row walk compiled worse with the gutter number's layer lookups (`readOnlyRow`, `fileRow`) inlined beside it: PT by source line, tree6's lines matched to the base's by their text, the same bytes walked, the inlined `fitEnd` byte loop +98k an op with no line and its checks reshuffled (body-appends +86k an op): `fillBody(comptime layered)`, as tree6's `comptime ghosted` was, chosen by `mapRows` and `bodyText` (a length test); (2) the 9P path asked the file's text and its offsets through calls: `bodyOf`, `fileDot`, `setFileDot`, `showFileOffset` answer with no layer by a length test, inline (core/ninep/pane.zig); (3) `open` (+8.8k since tree6, step 1's): not the change-id rule's regexp (it stands after the file rules and is never reached for a file) but its PARSE: pardes-perf's open boots a core each time and each core reads the rules at its first plumb (`Plumb.Parser.take` +4.0k, `expand` +1.4k, `feed` +1.2k, `endSet`, `word`, `append`, `stringToEnum`: +8.6k): the rule is deleted from core/plumbing and Look's own unresolved path takes a change id (core/look.zig `lookUnresolved`: eight letters or more, k to z, in a pane neither a raw terminal's nor a kind's, the rule's `src is pardes`; `jj.diffChange`; one naming no change searched for as before), no rule and no parse anywhere; (4) a client's key (+2.0..2.4k): the digest of File.State's two new fields, two small hash updates a pane a digest (Wyhash's buffered update and its memcpy): one field, `layer: Layer` (`owner`, `lines`: what were `layer` and `read_only`), digested by hand (`Layer.digest`: nothing hashed with no layer shown, a length test), its line in replica.zig's `hand_walked` (the test joining a client over a pane showing the layer); LEFT FOR THE COORDINATOR'S RULING: `terminal on all` +0.141% (+147k an op over the 18 terminal cells, +7.8k a terminal frame, the same in-run by an in-process counter around each cell): PT by line in the terminal's render cell: core/ansi.zig `recolor`'s per-cell style loop (source unchanged) compiled worse inlined into `body_layer.renderBody` after round 8's deletions there (`w.ghost`'s skips, `Pane.wrapAt`'s `ghost` field): what it buys is those deletions; `@call(.never_inline, ansi.recolor)` made it worse (+0.227%, and `deep-sel` +0.285%), not kept; perfops (the gate's malloc setting, load 2-9): v4 against tree6 120 of 121 within 0.1%, largest under the budget `client-key-down` on medium +0.065%; core-test 952/1118 (166 skipped) Debug tui
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/edit.zig')
-rw-r--r--core/edit.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/edit.zig b/core/edit.zig
index 0b08dc9e..3e57927a 100644
--- a/core/edit.zig
+++ b/core/edit.zig
@@ -777,7 +777,7 @@ fn treeIndent(e: Editor, t: *Text, text: []const u8, row: usize, at: usize) Erro
const tree = normal.fileTree(e.p, f) orelse return null;
// The tree is of the file's text, in its lines and offsets (the
// `Changes` layer's lines are none of it).
- if (f.read_only.len == 0) return indents.forNewline(e.scratch, l, tree, text, row, at);
+ if (f.layer.lines.len == 0) return indents.forNewline(e.scratch, l, tree, text, row, at);
return indents.forNewline(e.scratch, l, tree, try panes.File.fileText(f, e.scratch), panes.File.fileRow(f, row), panes.File.fileOffset(f, at));
}