Glenn Fowler wrote:
> On Mon, 28 Sep 2009 05:04:30 -0700 (PDT) bugzilla-daemon at np.grommit.com 
> wrote:
> > http://bugs.grommit.com/show_bug.cgi?id=640
> 
> > ------- Comment #1 from roland.mainz at nrubsig.org  2009-09-28 05:04 PDT 
> > -------
> > Created an attachment (id=343)
> >  --> (http://bugs.grommit.com/attachment.cgi?id=343&action=view)
> > Prototype patch for POSIX cksum (/usr/bin/cksum)
>
> (after perusing the url)
> it would be nice to see the improvements all of these ifdef sun* actually 
> produce

For a test file with 24884706 bytes in /tmp (=tmpfs/ramdisk):
- GNU "cksum" currently takes 181 seconds for 1000 iterations
- AST "cksum" (called as external program) currently takes 244 seconds
for 1000 iterations (partially caused by dragging more shared libraries
around, startup time issue with libast-based applications and some other
things)
- AST "cksum" called as ksh93 builtin takes 216 seconds for 1000
iterations (e.g. ~~24 seconds are saved compared to the external
application)

AST "cksum" called as external program with the patch now needs 188
seconds, as ksh93 builtin it needs 158 seconds

The basic idea of the patch is to prefetch memory block x+1, then cksum
block x, then prefetch block x+2, then cksum block x+1 etc. This reduces
the time the code has to spend waiting for data becoming "ready" (e.g.
loaded in the L1 cache or similar).

> also, has gnu bought back the ifdef sun*s?

No, it is unlikely that GNU will ever again add any optimizsed codepaths
for Solaris (unless the maintainers changed their mind from what Tim's
team got as "feedback" when they tried to submit some Solaris-specific
fixes in 2007).

BTW: I have a new patch queued for "cksum" which further improves the
performance (primarily by using a static table for "cksum"'s CRC data
and other stuff).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to