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");
|
_ = try self.to_client.write("\r\n");
|
||||||
},
|
},
|
||||||
.msg => |m| {
|
.msg => |m| {
|
||||||
|
@branchHint(.likely);
|
||||||
try self.to_client.print(
|
try self.to_client.print(
|
||||||
"MSG {s} {s} {s} {d}\r\n{s}\r\n",
|
"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| {
|
.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", .{
|
try self.to_client.print("HMSG {s} {s} {s} {d} {d}\r\n{s}\r\n", .{
|
||||||
hmsg.msg.subject,
|
hmsg.msg.subject,
|
||||||
hmsg.msg.sid,
|
hmsg.msg.sid,
|
||||||
|
|||||||
@@ -297,9 +297,11 @@ pub const Message = union(MessageType) {
|
|||||||
return .{ .connect = try res.dupe(alloc) };
|
return .{ .connect = try res.dupe(alloc) };
|
||||||
},
|
},
|
||||||
.@"pub" => {
|
.@"pub" => {
|
||||||
|
@branchHint(.likely);
|
||||||
return parsePub(alloc, in);
|
return parsePub(alloc, in);
|
||||||
},
|
},
|
||||||
.hpub => {
|
.hpub => {
|
||||||
|
@branchHint(.likely);
|
||||||
return parseHPub(alloc, in);
|
return parseHPub(alloc, in);
|
||||||
},
|
},
|
||||||
.ping => {
|
.ping => {
|
||||||
|
|||||||
Reference in New Issue
Block a user