Hi Rich, You replied before I was able to run the test but, yeah, you are right, my algorithm currently does the test word-based after it hits an aligned address, using a 3 instruction check to look for the null character.
As requested I attach a plot of muslstrlen vs mystrlen, as you stated my ASM version outperforms the C version. Cheers, Gabriel Gonzalez On Wed, Oct 3, 2012 at 8:12 PM, Rich Felker <[email protected]> wrote: > On Wed, Oct 03, 2012 at 01:54:23PM -0400, Rich Felker wrote: >> On Sat, Sep 29, 2012 at 02:48:48AM +0200, Gabriel Gonzalez wrote: >> > This version for ARM improves performance mainly unrolling the loop for >> > iterations >> > and reducing the instructions need to look for the null character. >> > A deeper analysis of this can be found at >> > http://www.gabrielgonzalezgarcia.com/2012/10/02/mystrlen-vs-android-bionics-strlen-on-arm-cpu/ >> > where you can find some data which back up the performance improvement. >> > I have only tested it on a little endian CPU so the BIG ENDIAN chunk might >> > need some testing >> >> I suspect this code is still considerably slower than the good C >> implementation, which looks something like: > > Never mind, looks like you're using the good algorithm. And gcc does a > rather bad job of optimizing it for ARM, so you should be able to beat > it easily. Cheers. > > Rich > _______________________________________________ > uClibc mailing list > [email protected] > http://lists.busybox.net/mailman/listinfo/uclibc
<<attachment: muslstrlen_mystrlen.png>>
_______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
