[About sorting a vector of bitsets]
*
ha*********@gmail.com:
* Alf P. Steinbach wrote: In the comparision function just loop over the bits till the first
difference.
This is exactly what I did, it's too slow. The vector contains more
than 10 million bitsets, each bitset contains more than 32*10 bits.
Ah. It's time for the Big Revelation (TM). Tweaking the comparision
function will at best buy you a small constant improvement, whereas
optimizing the _algorithm_ and/or _data structure_ can yield really
impressive results.
I think what you've related so far indicates you have a good handle
on the C++ side of things, but that's probably not where the problem
is. There are a number of techniques that can be applied at the C++
level but I fear that if I mention them they'll spur you to blindly
move ahead on a path that doesn't lead to any real solution. So:
What's it all for, i.e. what's the original problem that this huge
vector of bitsets, and sorting of it, is intended to solve?
Cross-posted to [comp.programming], where this probably belongs! ;-)
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?