Performance of the default Node Allocator.

Dhruv Matani dhruvbird@gmx.net
Fri Jan 23 08:47:00 GMT 2004


On Fri, 2004-01-23 at 04:36, Loren James Rittle wrote:
> In article <1074584842.1496.9.camel@home.free>,
> Dhruv Matani<dhruvbird@gmx.net> writes:
> 
> >> OK, BSF does not exist on every architecture.  The way to solve
this
> >> is rewrite the algorithm to use plain C.  Compare the version with
> >> plain C against the inline asm version.  I expect you might find
that
> >> there is little difference in speed.  If a measurable difference is
> >> seen, I will teach you how we want to handle this in the library.
> 
> > I replaced it with it's software equivalent (in plain C), and the
> > difference for my case is 0.02 ~ 0.03 seconds (which may go up for
> > larger inputs!), so is there any way that we could make the library
> > detect whether the current platform is i386, and if so, use the bsf
> > instruction, else use the software emulation?
> 
> Please see these files for a concrete example of what you need to do:
> 
> libstdc++-v3/config/cpu/generic/atomicity.h
> libstdc++-v3/config/cpu/i386/atomicity.h
> 
> >From the above, infer that you need to create an inline function
which
> will be used in other parts of the library.  I'd suggest adding a new
> file (e.g.) [...]/bit-set-first.h .
> 
> Then study this to see how to pick the generic version vs. a per-CPU
version:
> 
> libstdc++-v3/configure.host

Thanks! I'll be able to modify all these files next week (that's when I
have the compiler sources), because I'll be getting them over the
weekend. Is the testing on 3.3.2 (last release version) ok with you?


> Thank you for continuing to think about your patch's form while the
> FSF paperwork is handled.

You are most welcome, and thanks for the thanks ;-)



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





More information about the Libstdc++ mailing list