-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Custom BUFSIZ support #1799
Comments
Maybe calling https://en.cppreference.com/w/cpp/io/c/setvbuf somewhere in the file sink impl would do the trick? |
It should work, and spdlog can add a parameter to expose it to end users. |
Would be nice if you could try and report the actual performance gain. |
Here is a simple test of using different buffer size, and the results are significant. For simplicity, I only tested single-thread since the buffer is managed by myself. The
|
The default BUFSIZ parameter on most Linux systems is simply 8K. On my box, a
dd
command shows a buffer size of 512K would have much better performance. I wonder whether there is any way I can use a custom buffer size when creating a logger.In my case, spdlog is used to stream data to multiple (about 100) files. I suspect the default flush policy is hitting the disk too frequently, and would like to see whether there is any way to improve the performance.
The text was updated successfully, but these errors were encountered: