perf(grpc): avoid response JSON round-trip - #6259
Open
perfloop-agent wants to merge 2 commits into
Open
Conversation
perfloop-agent
requested review from
inancgumus and
janHildebrandt98
and removed request for
a team
August 7, 2026 01:53
Signed commits report2 of 2 commits between
This repository requires all commits to be signed. See GitHub docs on commit signature verification. |
|
|
perfloop-agent
force-pushed
the
perfloop-pr-open-4aesba2ndd
branch
from
August 8, 2026 00:41
60a3bc5 to
29de1a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Replace the JSON byte round-trip for non-discarded unary gRPC responses with direct conversion from dynamic protobuf reflection into the concrete values Sobek exposes to JavaScript.
Keep the protojson conversion as a fallback for malformed or unsupported messages, retain
EmitUnpopulatedsemantics, and add differential parity coverage. The converter documents the protojson behavior it mirrors and why field ordering is required for colliding JSON names.Why?
Sobek needs concrete map-like values for response property access, so response materialization remains necessary. This removes only the temporary JSON encoding and decoding for supported response messages.
DiscardResponseMessageand fallback behavior remain unchanged.Testing
go test -race ./internal/lib/netext/grpcextgo test -race ./internal/js/modules/k6/grpcgolangci-lint run --new-from-rev=53b5727d893d30a5c73e5b1a9891283786e0ec44 ./internal/lib/netext/grpcext/... ./internal/js/modules/k6/grpc/...On workload
16 KiB unary gRPC response through Client.Invoke, medianns/opmoved from 335295 to 113728 (66.1% lower).On workload
16 KiB unary gRPC response through Client.Invoke, medianB/opmoved from 135523 to 84563 (37.6% lower).On workload
16 KiB unary gRPC response through Client.Invoke, medianallocs/opmoved from 301 to 277 (8% lower).All 3 declared correctness checks passed.
Checklist
make check) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Not applicable: this is an internal implementation change with no user-facing API or documentation update.
Related PR(s)/Issue(s)
None.
Authored and verified by Perfloop: every claim above was co-measured on both trees and independently re-verified before submission — the full record is public: case_0ba99ytksb. Replies from this account are human-approved, and a human operator is accountable for this contribution.