diff options
| author | Robby Zambito <contact@robbyzambito.me> | 2026-01-01 05:12:51 +0000 |
|---|---|---|
| committer | Robby Zambito <contact@robbyzambito.me> | 2026-01-01 05:22:03 +0000 |
| commit | 45bd63dbe1e427f51114edf5df8a1f86dd9fd1b1 (patch) | |
| tree | 94e42dc5d1057c394fdcb7a3035c6060bcf9eb89 /src/main.zig | |
| parent | 5dea33367ee56abee7377f6e016d941a518f33b6 (diff) | |
Actually fast again???
way faster than before even??
coder@08714a4174bb:~$ nats bench pub foo -s localhost:4223
05:12:23 Starting Core NATS publisher benchmark [clients=1, msg-size=128 B, msgs=100,000, multi-subject=false, multi-subject-max=100,000, sleep=0s, subject=foo]
05:12:23 [1] Starting Core NATS publisher, publishing 100,000 messages
Finished 0s [====================================================================================] 100%
NATS Core NATS publisher stats: 574,666 msgs/sec ~ 70 MiB/sec ~ 1.74us
So cool.
src/server/client.zig JJ: M src/server/main.zig JJ: JJ: Lines starting with "JJ:" (like this one) will be
removed.
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 42a4d34..a1414c8 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const builtin = @import("builtin"); const zits = @import("zits"); const yazap = @import("yazap"); @@ -8,7 +9,7 @@ const Server = zits.Server; pub fn main() !void { var dba: std.heap.DebugAllocator(.{}) = .init; defer _ = dba.deinit(); - const gpa = dba.allocator(); + const gpa = if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) dba.allocator() else std.heap.smp_allocator; var app = yazap.App.init(gpa, "zits", "High performance NATS compatible client and server."); defer app.deinit(); |
