Skip to content

Conversation

@casperisfine
Copy link
Contributor

Profiling the lobsters benchmark I'm seeing a fairly large time spent joining tags in TaggedLogger.

That intruigued me, and by digging I noticed the requests UUIDs kept being appended but never removed.

So for every single request we have one more tag, this is skewing the benchmark a bit, as we spend much more time than we should in logging.

Capture d’écran 2024-09-06 à 17 49 33

Profiling the lobsters benchmark I'm seeing a fairly large time spent
joining tags in TaggedLogger.

That intruigued me, and by digging I noticed the requests UUIDs kept
being appended but never removed.

So for every single request we have one more tag, this is skewing
the benchmark a bit, as we spend much more time than we should in
logging.
@casperisfine
Copy link
Contributor Author

casperisfine commented Sep 6, 2024

After:

Capture d’écran 2024-09-06 à 17 53 40

Copy link
Contributor

@rwstauner rwstauner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is also benchmarks/railsbench/slow_methods.rb that could probably use the same fix

@casperisfine casperisfine merged commit 7f12bf0 into main Sep 6, 2024
@casperisfine casperisfine deleted the fix-tagged-logger-leak branch September 6, 2024 19:42
@casperisfine casperisfine restored the fix-tagged-logger-leak branch September 6, 2024 19:42
@casperisfine casperisfine deleted the fix-tagged-logger-leak branch September 6, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants