News for hackers. Stuff that matters.
Re:What to use instead of std::set [pdf] by greg7mdp on Thursday August 25, 2016 @11:19AM (#12359668)
Actually, if you don't need the entries to be sorted, the sparse_hash_set from https://github.com/greg7mdp/sparsepp is much faster than std::set or a sorted vector (except for iteration) and barely uses more memory than the sorted vector.
Re:What to use instead of std::set [pdf] by Ono-Sendai on Thursday August 25, 2016 @11:40AM (#12359905)
Or use unordered_set.
Re:What to use instead of std::set [pdf] by greg7mdp on Thursday August 25, 2016 @11:44AM (#12359932)
Well, you certainly could, but unordered_set will use significantly more memory than the sorted vector or sparse_hash_set, and is actually slower than sparse_hash_set.