Skip to content

Debug log inspection performance penalty #142

@hazardfn

Description

@hazardfn

It seems that even when the log level is set to :warn or :info the inspections made in debug logs are still executed despite not being used, this is because a straight string is passed to the Logger instead of anonymous functions (at least in the tracker).

See: https://elixirforum.com/t/use-of-inspect-in-log-messages/2100/7

A significant amount of reductions were seen in our app and many calls to printable? from within Swarm.Tracker we suspect this is the cause as large structures are inspected as part of the debug messages.

Ideally anonymous functions should be passed to Logger in all instances so disabled log levels don't incur a penalty when inspecting structures for printing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions