diff options
Diffstat (limited to 'src/syntax.zig')
| -rw-r--r-- | src/syntax.zig | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/syntax.zig b/src/syntax.zig index bbab17fa..43e370d5 100644 --- a/src/syntax.zig +++ b/src/syntax.zig @@ -120,12 +120,11 @@ fn forExt(ext: []const u8) !?Selected { return null; } -/// Compile the compact-tier queries eagerly so the first source open is fast. -pub fn compileStartupQueries() void { - if (!enabled) return; - for (&zig_specs) |*spec| _ = ensure(spec) catch {}; - for (&minimal_specs) |*spec| _ = ensure(spec) catch {}; -} +// Queries compile on first use (`ensure`), never at startup. Pre-compiling the +// compact tier in Pardes.init cost EVERY boot ~120ms of ts_query__perform_analysis +// (55% of a Debug startup) to save ~40ms on the first .zig/.c/.cpp open — a pane +// of prose or a shell paid for a language it never opened. Grammar availability +// is unchanged; only the timing moved. fn synFor(name: []const u8) Syn { for ([_]struct { []const u8, Syn }{ |
