Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2005 21:36:53 -0400
From:      "Matt Emmerton" <matt@gsicomp.on.ca>
To:        "Martin" <nakal@nurfuerspam.de>, <freebsd-current@freebsd.org>
Subject:   Re: Optimizing libc/string for amd64(?)
Message-ID:  <000701c5696f$0dee3b10$1200a8c0@gsicomp.on.ca>
References:  <42A242D1.4000002@nurfuerspam.de>

next in thread | previous in thread | raw e-mail | index | archive | help
> Hello,
>
> I ran nbench on different workstations and noticed that
> amd64-platform is really bad when doing "STRINGSORT".
>
> Sempron 2200+ (i386)  : 88 iterations/second
> Athlon64 3000+ (amd64): 32.15 iterations/second
>
> I looked inside nbench and it seems to call memmove
> very often. This is OK, in my opinion, so I investigated
> further.
>
> I've just looked inside libc how memmove/memcpy is
> handled there. The function is inside bcopy.c.
> I noticed that the "word" which is used for copying
> has the size of "int".
>
> Wouldn't it be better to set it to "typedef long word"?
> OpenBSD is using "long" there, for example, as I noticed
> later.
>
> I don't have amd64 at home, so I cannot really test
> everything out. Can someone of you take a look at the
> code in libc/string? There are various places that are
> using "int" instead of "long", e.g. also in memset-code.

It would probably be better to use int64_t and int32_t instead of long/int,
in order to make the intention more obvious.

--
Matt Emmerton




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000701c5696f$0dee3b10$1200a8c0>