mirror of
https://git.robbyzambito.me/zits
synced 2026-02-04 03:34:48 +00:00
Add branch hints for high performance messaging.
This commit is contained in:
@@ -65,6 +65,7 @@ pub fn start(self: *Client, io: std.Io, alloc: std.mem.Allocator, queue: *std.Io
|
||||
_ = try self.to_client.write("\r\n");
|
||||
},
|
||||
.msg => |m| {
|
||||
@branchHint(.likely);
|
||||
try self.to_client.print(
|
||||
"MSG {s} {s} {s} {d}\r\n{s}\r\n",
|
||||
.{
|
||||
@@ -77,7 +78,7 @@ pub fn start(self: *Client, io: std.Io, alloc: std.mem.Allocator, queue: *std.Io
|
||||
);
|
||||
},
|
||||
.hmsg => |hmsg| {
|
||||
std.log.debug("Sending hmsg: {any}", .{hmsg});
|
||||
@branchHint(.likely);
|
||||
try self.to_client.print("HMSG {s} {s} {s} {d} {d}\r\n{s}\r\n", .{
|
||||
hmsg.msg.subject,
|
||||
hmsg.msg.sid,
|
||||
|
||||
@@ -297,9 +297,11 @@ pub const Message = union(MessageType) {
|
||||
return .{ .connect = try res.dupe(alloc) };
|
||||
},
|
||||
.@"pub" => {
|
||||
@branchHint(.likely);
|
||||
return parsePub(alloc, in);
|
||||
},
|
||||
.hpub => {
|
||||
@branchHint(.likely);
|
||||
return parseHPub(alloc, in);
|
||||
},
|
||||
.ping => {
|
||||
|
||||
Reference in New Issue
Block a user