Re: improve strlen
- From: "jukka@xxxxxxxxxxxx" <spamtrap@xxxxxxxxxx>
- Date: Tue, 25 Oct 2005 03:15:21 +0000 (UTC)
Another 0.5 usec eliminated, now the difference is: 14.0 vs. 13.5
usec..
if ( v & 0x00008080 )
return s - ((v & 0x00000080) >> 7);
return s + 2 - ((v & 0x00800000) >> 23);
The next step is to handle 64 or 128 bits per iteration (atleast
64-bits should be trivial with MMX/SSE or natively 64-bit platform if
writing this in C/C++ ..)
Note that such version is liable for crashing because we cannot
guarantee that reads are within allocated boundaries anymore (unless we
allocate the memory ourselves taking care of the issue?)
.
- Follow-Ups:
- Re: improve strlen
- From: hutch--
- Re: improve strlen
- References:
- improve strlen
- From: Claudio Daffra
- Re: improve strlen
- From: spamtrap
- Re: improve strlen
- From: hutch--
- Re: improve strlen
- From: spamtrap
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- improve strlen
- Prev by Date: Re: About instruction lea
- Next by Date: Re: compiler generated output
- Previous by thread: Re: improve strlen
- Next by thread: Re: improve strlen
- Index(es):