Hacker GitHub

← All repos

Const-me/CollectionMicrobench

View on GitHub ↗ ★ 9 C++

Some C++ collections micromenchmark for vectors and lists.

12 mentions on Hacker News by 1 person: 1 story, 11 comments · first 2016-08-23 · latest 2023-09-27

Mentions per year 12 mentions · busiest year 2018 (5)
20082026
  1. Here’s a simple non-standard allocator for C++ I used a few times in the past: https://github.com/Const-me/CollectionMicrobench/blob/master... The block size is controlled with a template argument, the number must be a compile-time…
    comment by Const-me · 2023-09-27 · in Arena allocator tips and tricks
  2. In some cases, the performance of std::unordered_map is fixable with a custom allocator: https://github.com/Const-me/CollectionMicrobench
    comment by Const-me · 2019-07-29 · in Comparisons in C++20
  3. …linked list implementation (not mine, `CAtlList` from ATL) approaches or outperforms std::vector: https://github.com/Const-me/CollectionMicrobench Fortunately, in C++ we don’t pay for features we don’t use. If you want fast code, no need…
    comment by Const-me · 2019-01-18 · in Is C++ fast?
  4. …OK but just too slow. For example, I avoid using standard collections except strings and vectors: https://github.com/Const-me/CollectionMicrobench > to limit yourself to all the things that are basically available in C. C++ has a problem,…
  5. …you’ll only call malloc/free once per graph, not once per item. Look at the data in my repository: https://github.com/Const-me/CollectionMicrobench As you see, adding my custom allocator to these standard C++ collections improved…
    comment by Const-me · 2018-10-11 · in Rust has a static “garbage collector”
  6. On Windows, STL is often too slow: https://github.com/Const-me/CollectionMicrobench/
    comment by Const-me · 2018-05-03 · in Over 30? Too Old for Tech Jobs in China
  7. …For this case it’s essentially a random index. Besides, unordered_map memory locality is fixable: https://github.com/Const-me/CollectionMicrobench
  8. …lines of code, and plug it into any collection for non-trivial performance gain in some use cases: https://github.com/Const-me/CollectionMicrobench Another C++ feature helping me with these performance-critical calculations is OpenMP. Of…
  9. …one), e.g. 2-16MB RAM / each. If I need to erase elements, I include a free list such as this one: https://github.com/Const-me/CollectionMicrobench/blob/master... But the exact container is not that important here. If you don’t have that…
  10. …arrays, making assertions about locality is hard. It depends on the libraries you use. Take a look: https://github.com/Const-me/CollectionMicrobench As you see, in practice, a good linked list is same or slightly faster than std::vector.…
    comment by Const-me · 2017-07-31 · in RAM Is the New Disk
  11. Ported to C++, added two ATL collections, also added 100M elements data point: https://github.com/Const-me/CollectionMicrobench Arrays are still generally faster than lists. The funny thing is Microsoft’s linked lists are faster than C++…
    comment by Const-me · 2016-08-23 · in When Big O Fools You