From 1deaf7bc1bd04f5dc2a65804f8d6412ecfdf8dff Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Wed, 25 Nov 2026 06:07:53 -0500 Subject: [PATCH] perf(browser): return only forwarding fields used by the client The only JavaScript consumer already declares and reads pairs, files and watchBytes plus commands and capacity. Seven paired emitted-WASM runs over 200 updates and 20 identities reduced active return bytes by 88.0 percent and idle bytes by 98.9 percent; consumed outputs match across forwarding-limit transitions. Real WASM compilation, focused Core checks, TypeScript and 701 client tests pass. This measurement is serialization cost, not end-to-end media throughput. --- prototype/channel-browser/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/prototype/channel-browser/src/lib.rs b/prototype/channel-browser/src/lib.rs index 22a0bf525..7bacbf796 100644 --- a/prototype/channel-browser/src/lib.rs +++ b/prototype/channel-browser/src/lib.rs @@ -480,7 +480,15 @@ impl ForwardingBudget { Uuid::parse_str(user_id).map_err(|_| error("invalid_user"))?, &mut snapshot, ); - encode(&serde_json::json!({ "snapshot": snapshot, "commands": commands, "capacity": capacity })) + encode(&serde_json::json!({ + "snapshot": { + "pairs": snapshot.pairs, + "files": snapshot.files, + "watchBytes": snapshot.watch_bytes, + }, + "commands": commands, + "capacity": capacity, + })) } }