Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Rehashing Hash Tables And Associative Containers - Eduardo Madrid - CppNow 2022

Автор: CppNow

Загружено: 2022-08-03

Просмотров: 2748

Описание:

Slides: https://github.com/boostcon
CppNow Website: https://www.cppnow.org​
CppNow Twitter: @CppNow​
---

Rehashing Hash Tables And Associative Containers - Eduardo Madrid - CppNow 2022

One might think anything about mapping has been discussed twice already; however, because of the powers of Generic Programming we keep finding improvements, even substantial, both in terms of performance and modeling power.

In this presentation we will describe three avenues of improvement we think are novel, and report on their success after having been applied to a large codebase of an application used all over the world.

These are:

1. Opportunities unique to Generic Programming to model associative containers
2. Performance improvement, constexpr facilitation using a different API design to that of the standard map and unordered_map
3. An easy to implement mechanism for compile-time or constexpr "perfect hash tables"

1: The association between a key type and a mapped type can begin as a simple std::vector in which the key type is the index, for example if the set of indices is "dense"; if the application needs change, the good news is we have almost a continuum of data structures already implemented in libraries to choose from, to represent the mapping with optimal support for the new needs, including hash tables, red-black trees, b-trees, tries, Boost's "flat maps", multi-index, cache friendly search maps. The bad news is we don't have a more abstract notion of the association of a key type and a mapped/value type than specific containers, then the evolution of mapping needs in an application typically requires substantial refactoring and re-validation.

What can we do about this? I believe only C++ allows the expression of a very abstract concept such as the mapping between key and value in a way that allows specific realizations of the concept, specific data structures, to work with the same efficiency as they would alone by themselves. We have implemented that missing more abstract notion, we call it "Lookup", we will show how this abstraction decouples the real lookup or mapping needs from the specific implementation choices, and see how specific data structures such as boost::flat_map suffer from operating on two different levels of abstraction. "Lookup" is akin to other container adapters such as "stack" in that it relies on specific data structures but providing a more abstract API.

"stack" is comparatively a very simple container adapter, there are many more things to consider when abstracting key-value mapping, including invariants, algorithms, configuration parameters; we will show how we successfully applied the "expression style" techniques described last year in this conference by my team mate Oleksandr Bacherikov but to the subject of mapping/associative containers.

2: There are several deficiencies in the design of the standard mapping containers, including that they require the key and mapped value to be stored in std::pair, which is not optimal because most use cases require using just the keys far more often than the values, for example, just determining if a key is in the map; then this storage layout can become a significant performance inefficiency. We have made associative containers in which the keys and the mapped values are stored separately; we will detail the consequences and recommendations for alternatives and inter-operation with existing libraries.

3: Another deficiency in the standard is that there is no way to express a hashing function that can be called in two or more "phases". This is a good opportunity to illustrate principles with practical examples: we will put together all of the topics discussed by making a constexpr "perfect hash table" that is easy to make if the hash function allows invocation in phases, like the FNV hashing algorithm, and this will illustrate the benefits of the decoupling provided by "Lookup".
---

Eduardo Madrid
.
Tech Lead at Snap, Inc., helping performance on augmented reality of the Snapchat app. Author of open source libraries and components such as the Zoo type-erasure framework. Prior experience at Fintech, including automated trading. Several times presenter at CPPCon, C++ Now, C++ London
---

Videos Filmed & Edited By Bash Films https://bashfilms.com/
YouTube Channel Managed By Digital Medium Ltd: https://events.digital-medium.co.uk

#Boost​ #Cpp​ #CppNow​

Rehashing Hash Tables And Associative Containers - Eduardo Madrid - CppNow 2022

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Undefined Behavior in C++: A Performance Viewpoint - Fedor Pikus - CppNow 2022

Undefined Behavior in C++: A Performance Viewpoint - Fedor Pikus - CppNow 2022

C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance

C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance

Implementing Understandable World Class Hash Tables in C++ - Eduardo Madrid, Scott Bruce CppCon 2022

Implementing Understandable World Class Hash Tables in C++ - Eduardo Madrid, Scott Bruce CppCon 2022

Quasi-Static Template Registration and Generalized Serialization-Like Reconstruction and Traversal

Quasi-Static Template Registration and Generalized Serialization-Like Reconstruction and Traversal

Kubernetes — Простым Языком на Понятном Примере

Kubernetes — Простым Языком на Понятном Примере

Conversation with Elon Musk | World Economic Forum Annual Meeting 2026

Conversation with Elon Musk | World Economic Forum Annual Meeting 2026

ЗАНИМАТЕЛЬНАЯ ВЕРОЯТНОСТЬ. ЛЕКЦИЯ 21.11.2025 В РАМКАХ ЛЕКТОРИЯ ВДНХ

ЗАНИМАТЕЛЬНАЯ ВЕРОЯТНОСТЬ. ЛЕКЦИЯ 21.11.2025 В РАМКАХ ЛЕКТОРИЯ ВДНХ

49 минут, которые ИЗМЕНЯТ ваше понимание Вселенной | Владимир Сурдин

49 минут, которые ИЗМЕНЯТ ваше понимание Вселенной | Владимир Сурдин

Zed IDE: Полный обзор спустя год | Личный опыт разработки на ней

Zed IDE: Полный обзор спустя год | Личный опыт разработки на ней

More than a rehash   Joaquín M  López

More than a rehash Joaquín M López

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

Киберколониализм, или Почему чем яростнее беспредел, тем ближе стабилизация | Андрей Масалович

Киберколониализм, или Почему чем яростнее беспредел, тем ближе стабилизация | Андрей Масалович

CppCon 2016: Timur Doumler “Want fast C++? Know your hardware!

CppCon 2016: Timur Doumler “Want fast C++? Know your hardware!"

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Я УДАЛИЛ Claude Code – Вот, что я использую сейчаc

Я УДАЛИЛ Claude Code – Вот, что я использую сейчаc

Владимир Пастухов* и Алексей Венедиктов*. Пастуховские четверги / 22.01.26

Владимир Пастухов* и Алексей Венедиктов*. Пастуховские четверги / 22.01.26

🔴АУСЛЕНДЕР: от ГРЕНЛАНДИИ зависит все! Готовится великое ПРОТИВОСТОЯТИЕ

🔴АУСЛЕНДЕР: от ГРЕНЛАНДИИ зависит все! Готовится великое ПРОТИВОСТОЯТИЕ

Лучший Гайд по Kafka для Начинающих За 1 Час

Лучший Гайд по Kafka для Начинающих За 1 Час

Sean Baxter @Bloomberg: Circle Fixes Defects, Makes C++ Language Safer & More Productive

Sean Baxter @Bloomberg: Circle Fixes Defects, Makes C++ Language Safer & More Productive

Забрать Гренландию, забыть Украину? Трамп в Давосе | Спецэфир Русской службы Би-би-си

Забрать Гренландию, забыть Украину? Трамп в Давосе | Спецэфир Русской службы Би-би-си

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com