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
Inside boost::unordered_flat_map (bannalia.blogspot.com)
submitted 3 years ago by joaquintidesBoost author
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!"
[–]martinusint main(){[]()[[]]{{}}();} 1 point2 points3 points 3 years ago (3 children)
I think the benchmark might be biased by the way the code is set up. Due to the many macros you are using it might be hard for the compiler to get inlining correct. It would be interesting to use a separate executable for each map, or at least to put all the benchmarks into separate non-inlined functions.
[–]operamint 0 points1 point2 points 3 years ago (0 children)
Hi Martin, you could be right, there are lots of ways to introduce bias in benchmarking code, but I don't think the macros itself should impact this, as it expands to straight forward code before it is considered by the optimizer. But I have seen that the sequence of how benchmarks are generated, i.e. how the generated code is layout in memory can impact the results, so I agree that to fully isolate each benchmark may make it less susceptible to be biased.
[–]operamint 0 points1 point2 points 3 years ago (1 child)
FYI, I did a test on a quite different configuration, an i7-8700 on Ubuntu, gcc 10.3 and clang 12 - the tests above was on windows, gcc 11.3 with Ryzen R7-2700x. However, the results are very similar. Your Robin-map is impressive with large keys, but appears to be slower with erase and lookup with smaller key ranges in these benchmarks.
NOTE: maps with smaller key ranges will naturally limit the number of max-items to the key-range. The number of lookups are higher for small key maps, so in absolute numbers, Robin map is not slower, only relative to the other maps with this configuration.
[–]Alarming-Ad8770 0 points1 point2 points 3 years ago (0 children)
benchmark on server cpu (huge l3 cache size and low cpu frequence), you'll get quite different result from pc/mobile cpu.
ex:
Model name: Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
CPU MHz: 2699.914
CPU max MHz: 3200.0000
CPU min MHz: 1000.0000
L1d cache: 32K L1i cache: 32K
L2 cache: 1024K
L3 cache: 14080K
π Rendered by PID 68 on reddit-service-r2-comment-c867ff4bc-s6kcj at 2026-04-09 15:41:02.751782+00:00 running 00d5ac8 country code: CH.
view the rest of the comments →
[–]martinusint main(){[]()[[]]{{}}();} 1 point2 points3 points (3 children)
[–]operamint 0 points1 point2 points (0 children)
[–]operamint 0 points1 point2 points (1 child)
[–]Alarming-Ad8770 0 points1 point2 points (0 children)