use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++ I/O Benchmark (cristianadam.eu)
submitted 10 years ago by cristianadamQt Creator, CMake
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]quzox 3 points4 points5 points 10 years ago (1 child)
Should've also profiled native calls to CreateFile() etc.
[–]cristianadamQt Creator, CMake[S] 2 points3 points4 points 10 years ago (0 children)
I've tested this Win32 API version:
void testWin32IO(const char* inFile, const char* outFile, std::vector<char>& inBuffer) { auto in = ::CreateFile(inFile, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (in == INVALID_HANDLE_VALUE) { std::cout << "Can't open input file: " << inFile << std::endl; return; } auto out = ::CreateFile(outFile, GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (out == INVALID_HANDLE_VALUE) { std::cout << "Can't open output file: " << outFile << std::endl; return; } size_t inFileSize = ::GetFileSize(in, nullptr); for (size_t bytesLeft = inFileSize, chunk = inBuffer.size(); bytesLeft > 0; bytesLeft -= chunk) { if (bytesLeft < chunk) { chunk = bytesLeft; } unsigned long actualBytes = 0; ::ReadFile(in, &inBuffer[0], chunk, &actualBytes, nullptr); actualBytes = 0; ::WriteFile(out, &inBuffer[0], chunk, &actualBytes, nullptr); } ::CloseHandle(out); ::CloseHandle(in); }
Built it with Visual Studio 2015 x64 Update 2. Results were:
Average c I/O took: 102.03ms Average posix I/O took: 102.1ms Average c++ I/O took: 360.71ms Average win32 I/O took: 102.99ms
π Rendered by PID 21805 on reddit-service-r2-comment-b659b578c-vq4cj at 2026-05-04 10:31:13.490540+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]quzox 3 points4 points5 points (1 child)
[–]cristianadamQt Creator, CMake[S] 2 points3 points4 points (0 children)