News for hackers. Stuff that matters.
Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by quietbritishjim on Tuesday May 26, 2020 @04:54AM (#23308779)
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.

Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by jdrek1 on Tuesday May 26, 2020 @08:13AM (#23310130)
One 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_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...

Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by elithrar on Tuesday May 26, 2020 @08:45AM (#23310406)
There 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?)

Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by InAnEmergency on Wednesday May 27, 2020 @02:15AM (#23319910)
Yep. Like not handling the same corner cases or the same operating systems.
Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by m00dy on Tuesday May 26, 2020 @06:32AM (#23309335)
same 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.
Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by usefulcat on Tuesday May 26, 2020 @01:25PM (#23313897)
Not 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.

Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by vitaut on Tuesday May 26, 2020 @12:59PM (#23313541)
> 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

Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by dingo_bat on Tuesday May 26, 2020 @05:30AM (#23308963)
Documentation for C/C++ libraries is usually just the header file: https://github.com/expnkx/fast_io/blob/master/include/fast_i...
Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by colejohnson66 on Tuesday May 26, 2020 @04:56PM (#23316287)
I 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.
Re:I/O library 6x faster than fmt, 10x faster than stdio.h a... by expnkx on Wednesday May 27, 2020 @03:37AM (#23320434)