apache / apache/logging-log4cxx
Investigate different ways of writing to stdout
- Dominant language
- C++
- Stars
- 301
- Forks
- 142
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 29
Description
I came across this video the other day: https://www.youtube.com/watch?v=nH1YT1mrPt0
It's a faster(but much less flexible) way of doing logging.
The most important thing that I got out of it was the fact that the C library will do buffering. The lowest level that we do is to use [`fputs`](https://github.com/apache/logging-log4cxx/blob/18dd6730085fd2158e64e5588da56f98852a6812/src/main/cpp/systemoutwriter.cpp#L78). This will go through the C library and use the builtin C library buffering.
Since we have the ability to buffer data in log4cxx already using a `BufferedWriter`, do a test to see if it would be faster to avoid the C library buffering and do a `write()` system call directly to write data out.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/main/cpp/systemoutwriter.cpp, especially the fputs call, and inspect the existing BufferedWriter path. Compare direct write() calls with the current C-library-buffered approach under equivalent logging conditions. Done means a reproducible test or benchmark reports whether bypassing C buffering is faster.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100