summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig17
1 files changed, 17 insertions, 0 deletions
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 (-- <kind> <file> <line>:<col> [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);