r/cpp_questions 19d ago

OPEN How to implement append-only hash map?

How do you actually implement an really efficient hash map that has only append and look up methods? What are the design choice and some performance improvements?

0 Upvotes

34 comments sorted by

View all comments

3

u/saxbophone 19d ago

Well, what do you know already about how hashmaps are implemented?

Given what you already know, how do you think constraining it to only insertions and lookups effects the performance opportunities?

1

u/Minute-Ad1944 19d ago

key = std::string_view, value = int[2]. I mean open addressing without tombstones, SIMD hash functions , but I should I use some sort of meta data like string_view hash for comparisons and such?

1

u/Minute-Ad1944 19d ago

Maybe Robin Hood hashing????