Boost logo

Boost :

Subject: Re: [boost] [sort] pdqsort
From: Norbert Wenzel (norbert.wenzel.lists_at_[hidden])
Date: 2017-01-14 09:57:35


On 01/13/2017 10:05 PM, Marc Glisse wrote:
> (A naive question: do people ever sort a large, plain vector<int> or
> vector<double>? I don't think I've ever used sort with basic types, or
> at least not on large vectors where performance was critical. The
> closest would have the int/double as one element of a pair.)

Especially your second case is quite common in my work. I also have some
occasional vectors of integers only that need to be sorted. These are
(in my case) always lists of some hashes or indices that are ordered for
later (binary) searching if a special element exists. Both cases usually
involve between 10 and a few hundred million values.

So although I have to admit that sorting (and searching) these lists is
not where most of the time is spent in my work, it was fairly easy to
speed these parts up by simply using spreadsort over std::sort. So if I
get increased performance practically for free I say "Thank you!" and
take it.

Norbert


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk