diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-28 13:21:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 0b5ad7a30ba9e7c6eedcb426be294bd94219310f (patch) | |
| tree | 1a991acfb2a14f25ece19e13e65915dbbb48c7fc /src/syntax.zig | |
| parent | 95202b9b22751c86f100aae9ff1c64e535dcbd70 (diff) | |
| download | pardes-0b5ad7a30ba9e7c6eedcb426be294bd94219310f.tar.gz pardes-0b5ad7a30ba9e7c6eedcb426be294bd94219310f.zip | |
build.zig runners and testing improvements
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 }{ |
