Remix.run Logo
zellyn 4 hours ago

The one that comes to mind is how big your hash maps have to get before all the clever algorithms beat linear scan, and it's surprisingly large on modern computers: linear memory access is _very_ predictable.

The Roc and Zig folks probably have actual numbers.

tshaddox 3 hours ago | parent [-]

What are these surprisingly large numbers you've seen? I thought that linear scan optimizations are typically reserved for pretty small maps, like dozens or maybe hundreds of elements.

inigyou an hour ago | parent [-]

Hundreds sounds about right, maybe up to a thousand.

But nobody expects that. Hashmap is supposed to be faster once you have, like, ten elements. That's what was promised to us.

zellyn an hour ago | parent [-]

Yeah, I found hundreds surprising (although not on reflection).