Skip to content

Commit e00de6e

Browse files
committed
feat(zig/zzz): native optimized build
1 parent 53b8cb4 commit e00de6e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

frameworks/Zig/zzz/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub fn build(b: *std.Build) void {
1616
.optimize = optimize,
1717
.root_source_file = root_source_file,
1818
.strip = true,
19+
.omit_frame_pointer = false,
1920
});
2021
exe.root_module.addImport("zzz", zzz.module("zzz"));
2122
b.installArtifact(exe);

frameworks/Zig/zzz/src/main.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub fn main() !void {
6868
fn entry(rt: *Runtime, p: EntryParams) !void {
6969
var server = Server.init(.{
7070
.capture_count_max = 0,
71+
.connection_count_max = 4096,
7172
});
7273
try server.serve(rt, p.router, .{ .normal = p.socket });
7374
}
@@ -81,7 +82,7 @@ pub fn home_handler(ctx: *const Context, _: void) !Respond {
8182
.body = "Hello, World!",
8283
.status = .OK,
8384
.headers = &.{
84-
.{"Date", try ctx.allocator.dupe(u8, date[0..])},
85+
.{ "Date", try ctx.allocator.dupe(u8, date[0..]) },
8586
},
8687
});
8788
}
@@ -92,7 +93,7 @@ pub fn json_handler(ctx: *const Context, _: void) !Respond {
9293
.body = try std.json.stringifyAlloc(ctx.allocator, Message{ .message = "Hello, World!" }, .{}),
9394
.status = .OK,
9495
.headers = &.{
95-
.{"Date", try ctx.allocator.dupe(u8, date[0..])},
96+
.{ "Date", try ctx.allocator.dupe(u8, date[0..]) },
9697
},
9798
});
9899
}

frameworks/Zig/zzz/zzz.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN curl https://ziglang.org/download/${ZIG_VER}/zig-linux-$(uname -m)-${ZIG_VER
1414
tar xf zig-linux.tar.xz && \
1515
mv zig-linux-$(uname -m)-${ZIG_VER}/ /opt/zig
1616

17-
RUN /opt/zig/zig build -Doptimize=ReleaseFast
17+
RUN /opt/zig/zig build -Doptimize=ReleaseFast -Dcpu=native
1818

1919
EXPOSE 8080
2020

0 commit comments

Comments
 (0)