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

Periodic flush record files instead of flushing them on std::endl. #2782

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mint570
Copy link
Contributor

@mint570 mint570 commented May 17, 2023

What I did
Periodic flush record files instead of flushing them on std::endl.

Why I did it
For performance purposes. In our testing, this provides 8% end-to-end performance improvement.

How I verified it

Details if related

@lguohan
Copy link
Contributor

lguohan commented Aug 22, 2023

@mint570 , @prsunny , this seems like a big improvement. @mint570, can you explain a little more on why such change would have 8% performance improvement?

@mint570
Copy link
Contributor Author

mint570 commented Aug 28, 2023

This PR comes together with sonic-net/sonic-sairedis#1241.
There are some discussion there.

Flushing a file is expensive (depending on the FS). The original code flush the file on every write. This PR changes to flush every second (or when the buffer is full). This will increase the performance but the downside is that when the program crashes, we might miss some logs.

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