This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Performance of the default Node Allocator.
- From: Dhruv Matani <dhruvbird at gmx dot net>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Loren James Rittle <rittle at labs dot mot dot com>
- Date: 20 Jan 2004 14:20:31 +0530
- Subject: Re: Performance of the default Node Allocator.
- Organization:
> >> > And one more thing. What is the equivalent of the bsf instruction
on
> >> > other architectures.
> >>
> >> BSF, bit-set-first? BSF, branch-on-set-flag? Sorry, pending
> >> understanding of your intentions to file FSF paperwork, I haven't
> >> actually looked at your code yet.
>
> > I meant bit-set-first, if that's the instruction that gets a
particular
> > non-zero bit from the right.
>
> 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?
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/