Skip to content

Commit 2f124ad

Browse files
committed
fix: perf issues in hot paths
1. no unused timers, wrap tracing calls to avoid stringifying 2. track graceful end of the call and avoid emitting 'cancelled' in such cases 3. remove validate calls in metadata on operations where it's not needed 4. refactor server session stream handlers into separate channelz enabled/disabled handlers 5. refactor message request logic - reduce amount of microtasks generated 6. improve sendStatus a little when there is no metadata involved
1 parent c84b4f9 commit 2f124ad

File tree

5 files changed

+502
-388
lines changed

5 files changed

+502
-388
lines changed

packages/grpc-js/src/call-stream.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export interface StatusObject {
9797
metadata: Metadata;
9898
}
9999

100+
export type PartialStatusObject = Pick<StatusObject, 'code' | 'details'> & {
101+
metadata: Metadata | null;
102+
}
103+
100104
export const enum WriteFlags {
101105
BufferHint = 1,
102106
NoCompress = 2,

0 commit comments

Comments
 (0)