swarm icon indicating copy to clipboard operation
swarm copied to clipboard

Debug log inspection performance penalty

Open hazardfn opened this issue 3 years ago • 0 comments

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.

hazardfn avatar Jul 16 '20 07:07 hazardfn