Skip to content

Performance Concern in grpc-java: Unnecessary Stack Trace Computation #12134

Closed

Description

@MarcGuiot

Hi,

In the following code snippet:
InternalSubchannel.java the log message string is built even if it is not ultimately used.

The toString() method of ConnectivityStateInfo calls toString() on the Status object. If the Status contains an exception, its stack trace is computed via getStackTrace().

In our usage of gRPC—where we enforce retries to many servers, some of which may be down—this stack trace computation shows up in our profiler and accounts for a few percent of CPU usage.

Thank you,
Marc Guiot

Activity

  1. locked as resolved and limited conversation to collaborators on Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions