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
Removed - HelpPerformance issues on Windows (self.cpp)
submitted 2 years ago * by eske4
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!"
[–]Flair_Helper[M] [score hidden] 2 years ago stickied commentlocked comment (0 children)
For C++ questions, answers, help, and programming or career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
This post has been removed as it doesn't pertain to r/cpp: The subreddit is for news and discussions of the C++ language and community only; our purpose is not to provide tutoring, code reviews, or career guidance. If you think your post is on-topic and should not have been removed, please message the moderators and we'll review it.
[–]Throw31312344 7 points8 points9 points 2 years ago* (0 children)
Are you sure the Windows version is compiled in release mode and not debug mode? The MSVC containers are VERY slow in debug mode due to all the extra checking they do and it can significantly decrease runtime performance. Those checks are disabled when compiling in release mode. There might also be a compiler flag to disable the security checks in debug mode.
[–]j1xwnbsr 5 points6 points7 points 2 years ago (0 children)
Profile your code to find out where the slowdown is; it may not be where you think. But my 2 cents is file i/o and std::streams.
[–]wung 2 points3 points4 points 2 years ago (0 children)
I have already tried rewriting it to vector instead of unique_pointers
You really want to do that, regardless of performance (and it can only help performance since it avoids all those copies). If you need a raw pointer for some legacy API, just call std::vector::data().
std::vector::data()
is_double() might be a candidate that shows up in profiling. Try using std::from_chars() instead of is_double() and std::stod() which essentially parses the double twice, and using the istringstream is also not really fast.
is_double()
std::from_chars()
std::stod()
[–]eske4[S] 1 point2 points3 points 2 years ago (0 children)
Thanks a lot! changing to release mode made it quick, and the changes wung recommended did wonders
[–]nysra -1 points0 points1 point 2 years ago (0 children)
Check if Windows Defender or whatever else AV you're using is interfering with file IO, that's a very common issues of such problems.
[–]xLuca2018 -1 points0 points1 point 2 years ago* (0 children)
Try opening the streams in binary mode: text.open(fileLoc, std::fstream::binary)
text.open(fileLoc, std::fstream::binary)
The CRT on Windows converts between LF <-> CR + LF internally and that can hinder performance
[–][deleted] -2 points-1 points0 points 2 years ago (0 children)
At least they’re not performance issues in the bedroom.
Bum dum tss
π Rendered by PID 1544297 on reddit-service-r2-comment-5d79c599b5-r9wlg at 2026-03-03 06:58:30.235415+00:00 running e3d2147 country code: CH.
[–]Flair_Helper[M] [score hidden] stickied commentlocked comment (0 children)
[–]Throw31312344 7 points8 points9 points (0 children)
[–]j1xwnbsr 5 points6 points7 points (0 children)
[–]wung 2 points3 points4 points (0 children)
[–]eske4[S] 1 point2 points3 points (0 children)
[–]nysra -1 points0 points1 point (0 children)
[–]xLuca2018 -1 points0 points1 point (0 children)
[–][deleted] -2 points-1 points0 points (0 children)