[(nowhere)] Thought you might want to see this...

Dhruv Matani dhruvbird@gmx.net
Fri May 7 14:23:00 GMT 2004


On Thu, 2004-05-06 at 20:26, Paolo Carlini wrote:
> Brad Spencer wrote:
> 
> >Perhaps this is because the default allocator in 3.4.0 is "new", which
> >is much slower on Solaris?
> >
> Indeed, this is rather possible (I wanted to post something about 
> that!), however
> a factor of 30 seems a little too much, don't you think?

I need to see the code for the STL shipped with SUN studio, but I have a
hunch that this has got to do with the fact that equal_range internally
calls lower and upper_bound both. Now, if the application has only say
at max 2~3 duplicates per value, then for a huge data set, this would be
an overkill. *Maybe* the STL with sun studio uses the approach of
incrementing the iterator returned by lower_bound and comparing
repeatedly the value with the value to be searched until an
odd(non-equal) value is found or end() is reached.

Just a hunch though?



-- 
        -Dhruv Matani.
http://www.geocities.com/dhruvbird/

Proud to be a Vegetarian.
http://www.vegetarianstarterkit.com/
http://www.vegkids.com/vegkids/index.html




More information about the Libstdc++ mailing list