Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I'm afk but I suggest using map[uint64]struct{} to reduce memory usage over map[uint64]bool and I recommend benchmarking different sized source slices. 10 items is nothing.

Author covers both of these comments in the article (though they don't disclose how large their "larger" slice is). (edit: actually I misread you, sorry. You're right about empty structs vs interface).

> Maps don't preserve order

The author's approach using maps preserves order in the result, they are comparing the approach to the sort solution which does not preserve order, not claiming that maps themselves preserve order.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: