Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs: Guard frequently called logs behind if check #2774

Merged
merged 1 commit into from
Mar 2, 2024
Merged

Commits on Mar 2, 2024

  1. logs: Guard frequently called logs behind if check

    Moves a number of heavily called debug lines behind if checks to avoid
    needless allocations of Fields objects and stringification of fields.
    For cases where the server is not set to "debug" log level, these fields
    were allocated on the heap and then immediately discarded - as well a
    number of these were stringifying state / NLRIs regardless of log level.
    
    In servers with significant amounts of routes and BGP peers, this lead
    to a large amount of wasted allocations - in our case looking at Go's
    memory profiler, 25% of all allocations were from these lines alone.
    Dawn Minion authored and fujita committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    003745a View commit details
    Browse the repository at this point in the history