Martijn Faassen on Nostr: I have had to retune my intuitions about hash maps for Rust. In some cases scanning ...
I have had to retune my intuitions about hash maps for Rust. In some cases scanning an array can be faster than a hash map lookup, due to cpu caches and the like! The algorithmic complexity of array scanning is worse but the real world performance can be much faster, for sufficiently small arrays.
This kind of stuff is very unlikely in Python.
#rustlang
Published at
2023-08-11 11:18:45Event JSON
{
"id": "24d6ec51b11317b3c01bfb480bc26a86643d786f1ca89e8f7ae36785e4a20cb2",
"pubkey": "616c1b2daf1ac2d384a9a126a8e9d1e93ac700960bee8f28e855c06f59387e8e",
"created_at": 1691752725,
"kind": 1,
"tags": [
[
"t",
"rustlang"
],
[
"proxy",
"https://fosstodon.org/users/faassen/statuses/110870706622742374",
"activitypub"
]
],
"content": "I have had to retune my intuitions about hash maps for Rust. In some cases scanning an array can be faster than a hash map lookup, due to cpu caches and the like! The algorithmic complexity of array scanning is worse but the real world performance can be much faster, for sufficiently small arrays.\n\nThis kind of stuff is very unlikely in Python.\n\n#rustlang",
"sig": "9867cd21e0dd4683d44858df7d32e517a5b34f47264ac91a4d4344204029cf9114dc574db86f3bc2bab3c71f839a039b8ef5a3903be03560eb1c6ee3d96ecd7c"
}