by quietbritishjim · 6y ago · 0 comments
* What is the core implementation idea behind this library? Why is it supposedly so much faster than stdio and fmt? There doesn't seem to be much explanation in the readme. The only thing I can see is "Locale support optional" and "Zero copy IO" but these are mixing up formatted and unformatted interfaces - it is supposed to be faster at both? Does the "zero copy IO" mean that it's unbuffered (as another comment here mentioned, that usually makes things slower not faster)?
* What does the API look like? There's no documentation whatsoever - the "documentation" heading in the readme just refers to "./doxygen/html/index.html" which doesn't exist in the repo; I can't even see a Doxyfile. Just a brief example in the readme showing reading and writing would be nice!
* What exactly is it faster at? Reading or writing? Formatted or unformatted IO? If formatted, is it just the formatting that's faster (e.g. is there also a comparison against fputs)? The benchmarks section has no detail of what code was compared except a mention of the examples/ directory, but that contains dozens of subdirectories, most of which each have multiple files in them. I find it quite implausible that it's 6x faster at formatting than fmt, and benchmarks are notoriously hard, so combined with the extreme lack of clarity I find it hard to take these claims seriously.
[1] https://www.reddit.com/r/cpp/comments/dc5t1n/reply_to_herb_s...
[2] https://www.reddit.com/r/cpp_questions/comments/efuemt/c_wit...
[3] https://www.reddit.com/r/cpp_questions/comments/f7zgat/why_d...
A great many of these libraries are also, unfortunately, “newbie traps” (faster is better, right?)
Source: have spent a fair amount of time working on speeding up human-readable log output, the performance of which tends to be dominated by formatting.
Indeed.
> I can't really see how it could be optimised to gain 6x speed up.
Performance claims appear to not even be based on I/O but only on two formatting microbenchmarks and are severely misleading https://news.ycombinator.com/item?id=23311726