2 ms·
Indeed. Go maps are slow as hell. Everytime I need them in a tight loop, I have to make an ad-hoc equivalent with slices, if at all possible.
by sacado2 8y ago
Indeed. Go maps are slow as hell. Everytime I need them in a tight loop, I have to make an ad-hoc equivalent with slices, if at all possible.
- _old_dude_ 8y agoI believe it's because map access are not inlinined in Go. Swift uses a similar strategy as Go to implement dictionary (a runtime data structure that describe data access is sent as a supplementary parameter) but the backend of Swift is able to inline most of the calls. So at some point in the future, Go maps may be faster.