Перейти к содержимому

Mastering the unordered_map in C++ - Kevin B. Carpenter - ACCU 2026

ACCU Conference и cpponsea

0:00 / 0:00

Mastering the unordered_map in C++ - Kevin B. Carpenter - ACCU 2026

3 635 просмотров · 8 дней назад
ACCU Conference и cpponsea
3 635 просмотров · 8 дней назад
ACCU Membership: https://tinyurl.com/ydnfkcyn --- O(1) or O(no-no-no) - Mastering the unordered_map - Kevin B. Carpenter - ACCU on Sea 2026 --- In modern C++, std::vector is king. We justifiably reach for it as our default, cache-friendly, contiguous sequence. But what happens when your problem doesn't fit a simple array? What is the second container you should reach for? This talk dives deep into the data that proves std::unordered_map is the undisputed #2 container in modern C++ codebases. Its dominance signifies a fundamental shift in application design: the overwhelming, performance-critical need for average-case key-value lookups. Join this session as we move beyond "just use a hash map" and explore the critical, real-world implications of this choice. We'll start by benchmarking the classic std::map (red-black tree) against std::unordered_map (hash table) to understand precisely what you gain—and what you might lose. But this power comes with pitfalls. An "average-case" can quickly degrade to a catastrophic without warning. We will profile and dissect the true costs of using a hash map: The Hash: What makes a good hash function? We'll go beyond std::hash and learn how to write effective, fast hashers for your custom types. The Collision: How do different collision-handling strategies impact performance and memory? The Re-hash: What is the "load factor," and when does the hidden cost of a full table re-hash destroy your performance gains? We'll conclude with a practical decision-making framework for when to choose std::unordered_map, when to fall back on the ordered std::map, and how std::string—the container we often forget is a container—fits into this modern landscape. You will leave this session with the ability to stop guessing and start knowing precisely which data structure to deploy for maximum performance. Slides: https://github.com/Digital-Medium/ACC... --- Kevin B. Carpenter Kevin Carpenter, an experienced Software Engineer, excels in crafting high-availability C++ solutions for Linux and Windows, with expertise in transaction software, financial modelling, and system integration. As a Lead Project Engineer, he ensures secure, high-speed credit card transactions. In his prior position, he played a lead role in developing an interest rate risk model for large credit unions, enhancing legacy code, and optimizing ERP data integration. Kevin actively engages in the C++ community, volunteering at conferences like ACCU, CppCon, C++ on Sea, and SwiftCraft, where he holds key positions such as Speaker Liaison and Volunteer Coordinator/Chair. His diverse contributions to the C++ community showcase his commitment to excellence and drive for collaborative growth, leaving a lasting impact in the tech world. Video Sponsored By JetBrains, Bloomberg Engineering & HRT --- The ACCU on Sea Conference is the annual conference of the ACCU membership, but is open to any and all who wish to attend. The tagline for the ACCU is 'Professionalism in Programming', which captures the whole spectrum of programming languages, tools, techniques and processes involved in advancing our craft. While there remains a core of C and C++ - with many members participating in respective ISO standards bodies - the conference, like the organisation, embraces other language ecosystems and you should expect to see sessions on C#, D, F#, Go, Javascript, Haskell, Java, Kotlin, Lisp, Python, Ruby, Rust, Swift and more.The ACCU on Sea Conference is a conference by programmers for programmers about programming. Discounted rates for members. ACCU Membership: https://tinyurl.com/ydnfkcyn 2026 Program: https://https://accuonsea.uk/2026/schedule/in... https://accu.org https://www.accuconference.org/ https://mastodon.social/@ACCUConf   / accu-conference   https://bsky.app/profile/accuconf.bsk...   / accuorg     / accuconf   --- YouTube Videos Filmed, Edited & Optimised by Digital Medium: https://events.digital-medium.co.uk #cpp #cplusplus #programming #coding #softwareengineering #softwaredeveloper #code #cplusplusprogramming #cplusplustutorial #cplus #softwaredevelopment #coder #talk