Skip to content

Commit

Permalink
fix: perf issues in hot paths
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AVVS committed Oct 19, 2022
1 parent c84b4f9 commit 2f124ad
Show file tree
Hide file tree
Showing 5 changed files with 502 additions and 388 deletions.
4 changes: 4 additions & 0 deletions packages/grpc-js/src/call-stream.ts
Expand Up @@ -97,6 +97,10 @@ export interface StatusObject {
metadata: Metadata;
}

export type PartialStatusObject = Pick<StatusObject, 'code' | 'details'> & {
metadata: Metadata | null;
}

export const enum WriteFlags {
BufferHint = 1,
NoCompress = 2,
Expand Down

0 comments on commit 2f124ad

Please sign in to comment.