bitwalker / bitwalker/swarm

Debug log inspection performance penalty

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.3k
Forks
110
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing debug logging and inspection calls in Swarm.Tracker, then check for similar Logger calls elsewhere in the project. The work is done when disabled debug levels no longer evaluate large structures for logging and the relevant behavior is covered by the project's tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.