Re: improving the string library


Subject: Re: improving the string library
From: Vlad Harchev (hvv@hippo.ru)
Date: Thu Dec 21 2000 - 13:12:39 CST


On Thu, 21 Dec 2000, Tomas Frydrych wrote:
>
> I spent some time today examining how much faster the string
> functions would be if written in assembler and hand optimised. I
> have come up with the following:
>
> strcmp: 4% improvement
> strlen: 6%
> strstr: 85%
> UT_UCS_strcmp: 350%
> UT_UCS_strlen: 250%
> UT_UCS_strstr: 44%
>
> The Linux system strcmp and strlen (which AbiUses) have been
> written in asm, but not fully optimised. strstr is, I think, written in C,
> and so are the rest; the 200-300% speed up on the C
> implemantions is in my experience not unusual.
>
> I will have a go at some of the other functions as well when I have
> the time; I think this might be worth the effort.
> (I use NASM, so there would be no difficulties with compilation of
> the asm sources on pretty much any x86 machine; obviously non-
> x86 users could not take any advantage of this, but then they
> would be no worse off either.)

 GAS's (gnu assembler) syntax is totally different from NASM's one (order of
operands, etc). You have to use C preprocessor and macros for asm code to be
compiled by gnu tools (i.e on Linux, BSD and possible Solaris for x86, and
even may be QNX and BeOS for x86 since they use gnu toolchain AFAIR).

> Tomas
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Thu Dec 21 2000 - 13:58:00 CST