This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strdup versus strlen/malloc/memcpy


Hi,

While doing optimalisations to some software I wrote I noticed that my
own strdup implementation is much slower then the standard strdup
implementation. This is strange as my own implementation is exactly the
same as the glibc one. What is even more strange is that the difference
in speed is NOT CONSTANT: the larger the string, the bigger the
difference in executiontime.
Now I'm not asking you to debug my code (quiet a
few eyeballs went over it already). I'm just wondering what might
causing this difference. Especially I'm wondering if maybe something is
wrong with the strlen or malloc or mempcpy implementation when called
from your own code.
In case anyone would like to check what I did: the code, logfiles and
some gnuplot graphs can be found at:
http://www.vanheusden.com/misc/strdup/


Folkert van Heusden

www.vanheusden.com/multitail - multitail is tail on steroids. multiple
               windows, filtering, coloring, anything you can think of
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]