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

Fix a leak in Lobsters benchmark #322

Merged
merged 2 commits into from
Sep 6, 2024
Merged

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

benchmarks/railsbench/benchmark.rb Show resolved Hide resolved
@casperisfine casperisfine merged commit 7f12bf0 into main Sep 6, 2024
4 checks passed
@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.

4 participants