Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2011 11:28:20 +0100
From:      Marius Strobl <marius@alchemy.franken.de>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r228857 - in head/usr.bin: . csup
Message-ID:  <20111226102820.GT90831@alchemy.franken.de>
In-Reply-To: <4EF645D2.8080407@FreeBSD.org>
References:  <201112241216.pBOCGd1H012696@svn.freebsd.org> <4EF645D2.8080407@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Dec 24, 2011 at 01:36:18PM -0800, Doug Barton wrote:
> On 12/24/2011 04:16, Marius Strobl wrote:
> >   On FreeBSD just use the MD5 implementation of libmd rather than that of
> >   libcrypto so we don't need to relinquish csup when world is built without
> >   OpenSSL.
> 
> Did you benchmark this at all? I agree that keeping csup available
> absent openssl is a good goal, but csup is a prototypical "tool that
> does the same thing many thousands of times" so even tiny regressions
> could add up to a large cost in wall clock time.

Well, in a real world test updating the same base on an amd64 machine
connected to the Internet via Fast Ethernet from a national mirror
with csup once linked against libcrypto and once against libmd and
also with CVSup the csup linked against libmd actually was fasted
with 29:51.37, followed by CVSup with 32:07.52 and csup linked against
libcrypto with 34:49.88. This was with the libmd run done after the
libcrypto run so in theory the former might even have picked up some
more deltas than the latter. On the other hand the MD5 implementation
of libmd is known to be 18-20% slower at least on x86 that that of
libcrypto (probably due to its assembler implementation). I only can
reliably reproduce that when checksumming files starting in the
several hundreds MB range, at least when they are on disk. So in
order to also see that slowdown with csup linked against libmd I
guess you'd at least need some artificial setup with both server and
client being on the LAN and having the repositories on memory backed
disks, if at all possible. Using the libmd MD5 implementation for
csup doesn't seem to have a real world impact though.

> 
> If the openssl version is faster, then conditionalizing where to get md5
> is probably the right answer.
> 

If we really cared about the MD5 performance of applications linked
against libmd (including md5(1)), we should just optimize that MD5
implementation rather than working around it.
Also for csup, fixing the problem that is causing it to fetch whole
files over and over again likely would improve its performance way
more than using a different MD5 implementation could do.

Marius




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111226102820.GT90831>