Startup Time Allocated Lists for Zig
zig build --watch test -Doptimize=ReleaseSafe
-
Declare zBench as a dependency in
build.zig.zon
:.{ .name = "my-project", .version = "1.0.0", .paths = .{""}, .dependencies = .{ + .double_slice = .{ + .url = "https://github.com/stoand/double_slice/archive/<COMMIT>.tar.gz", + }, }, }
-
Add the module in
build.zig
:const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); + const opts = .{ .target = target, .optimize = optimize }; + const double_slice_module = b.dependency("double_slice", opts).module("double_slice"); const exe = b.addExecutable(.{ .name = "test", .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); + exe.root_module.addImport("double_slice", double_slice_module); exe.install(); ... }