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

Use ZeroLog.LogManager.Flush() in benchmarks #176

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

ltrzesniewski
Copy link
Contributor

This PR updates ZeroLog in benchmarks and replaces some usages of its LogManager.Shutdown method with LogManager.Flush.

When I sent #127, I made a note that we should expose a Flush method for benchmarking, as I had to use Shutdown, which worked but was incorrect (it allocates, takes a longer time, does more than necessary, etc). We were using an internal WaitUntilQueueIsEmpty method in ZeroLog benchmarks but I couldn't use it here. Oops. 😅

This PR therefore uses the new Flush method where it is the correct thing to do. Benchmark results are barely affected though.

@neuecc
Copy link
Member

neuecc commented Aug 14, 2024

That's great.
I'd like to set up a fair benchmark as accurately as possible, so this is really helpful!

@neuecc neuecc merged commit 05048db into Cysharp:master Aug 14, 2024
1 check passed
@ltrzesniewski ltrzesniewski deleted the zerolog-flush branch August 14, 2024 11:05
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.

2 participants