I want to pose a seemingly simple question that i can't find the answer nowhere. Is there a FAST modern algorithm for file input and/or output that can be compiled with all standard compliant C++ compilers and works for all operating systems without the requirement of external libraries ?
Have you ever seen something so crazy been researched by anyone else except me ? Is such an algorithm even possible ?
Thanks for any recommendations
With the following restrictions:
can be compiled with all standard compliant C++ compilers and works for all operating systems without the requirement of external libraries ?
You've pretty much restricted yourself to the standard library file IO functions. Maybe POSIX functions (depending on what subset of "all standard compliant C++ compilers" you're considering).
If they aren't fast enough for you, you'll have to start dropping some restrictions.
This has nothing to do with an "algorithm".
When it comes to writing data to a file, you're at the mercy of the operating system - memory-mapped files are "fast" because you're just writing to memory, and the OS syncs it back out on its own time. If the OS doesn't support it, you're out of luck in that regard - unless you want to implement your own memory-mapping layer.
Incidentally, POSIX has mmap
, so if you're limiting yourself to POSIX-compliant systems, you're fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With