7 ms·
I find the lack of clarity about this library quite suspicious. * What is the core implementation idea behind this library? Why is it supposedly so much faster
by quietbritishjim 6y ago
I find the lack of clarity about this library quite suspicious.
* 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.
- dingo_bat 6y agoDocumentation for C/C++ libraries is usually just the header file: https://github.com/expnkx/fast_io/blob/master/include/fast_io.h https://github.com/expnkx/fast_io/blob/master/include/fast_i...
- colejohnson66 6y agoI was expecting there to be Doxygen comments in there, but there wasn’t. So, no, this header is not documentation. I don’t want to read all the code to understand how to use a library; I want examples.
- dingo_bat 6y agoIt's not hard to find examples in the repo. https://github.com/expnkx/fast_io/blob/master/examples/0001.helloworld/hello_world_win32_box.cc https://github.com/expnkx/fast_io/blob/master/examples/0001.... The code is self documenting. I don't think doxygen comments are always needed. This is a simple library, with a simple interface.
- expnkx 6y agohttps://github.com/expnkx/fast_io/wiki https://github.com/expnkx/fast_io/wiki wiki here
- m00dy 6y agosame here. All i/o libraries eventually hit OS barrier. I can't really see how it could be optimised to gain 6x speed up. I/O libraries are basically transporters between userland and kernel space.
- vitaut 6y ago> All i/o libraries eventually hit OS barrier 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 https://news.ycombinator.com/item?id=23311726
- usefulcat 6y agoNot when formatting is involved. stdio and iostreams are notoriously not particularly fast when it comes to formatting. So, while I don't know anything about this particular library, the 6x figure does not sound suspicious to me. 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.
- jdrek1 6y agoOne should probably point out that the library/readme is not the only suspicious thing. The author often has huge problems with terminology and/or communication in general. He routinely confuses output with formatting, which might explain some of the "benchmark results". [1] https://www.reddit.com/r/cpp/comments/dc5t1n/reply_to_herb_sutter_about_zerooverhead/ https://www.reddit.com/r/cpp/comments/dc5t1n/reply_to_herb_s... [2] https://www.reddit.com/r/cpp_questions/comments/efuemt/c_with_concepts_or_c_with_classes/ https://www.reddit.com/r/cpp_questions/comments/efuemt/c_wit... [3] https://www.reddit.com/r/cpp_questions/comments/f7zgat/why_does_printf_and_stdcout_bloat_my_binary_does/ https://www.reddit.com/r/cpp_questions/comments/f7zgat/why_d...
- elithrar 6y agoThere has been an ongoing trend of publishing “faster” libraries with shaky foundations around the performance claims. A great many of these libraries are also, unfortunately, “newbie traps” (faster is better, right?)
- InAnEmergency 6y agoYep. Like not handling the same corner cases or the same operating systems.