From 3f4f26e0e40d06427e72f72e760d01adcdc0326c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 15 Sep 2026 18:52:46 -0300 Subject: Reuse bounded source analysis and speed up result context traversal --- build.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 8a5b4c41..aeae7443 100644 --- a/build.zig +++ b/build.zig @@ -1009,6 +1009,23 @@ pub fn build(b: *std.Build) void { const lspprobe_step = b.step("lspprobe", "one language query against the real seam (-- : [arg] [--reps N])"); lspprobe_step.dependOn(&run_lspprobe.step); + const locations_bench_step = b.step("locations-bench", "measure cold/warm result formatting (-Doptimize=ReleaseFast; CSV on stderr)"); + if (optimize != .ReleaseFast) { + locations_bench_step.dependOn(&b.addFail("locations-bench requires -Doptimize=ReleaseFast").step); + } else { + const locations_bench_module = b.createModule(.{ + .target = target, + .optimize = .ReleaseFast, + .root_source_file = b.path("test/locations_bench.zig"), + .link_libc = true, + }); + locations_bench_module.addImport("pardes", core_module); + const locations_bench = b.addTest(.{ .root_module = locations_bench_module, .filters = &.{"locations benchmark cold and warm formatting"} }); + const run_locations_bench = b.addRunArtifact(locations_bench); + run_locations_bench.has_side_effects = true; + locations_bench_step.dependOn(&run_locations_bench.step); + } + const perf_optimize: std.builtin.OptimizeMode = .ReleaseFast; const perf_options = b.addOptions(); const perf_target = std.Target.Query.fromTarget(&target.result); -- cgit v1.3