[hashcash] Re: Hashcash performance improvements

  • From: Adam Back <adam@xxxxxxxxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Sun, 30 May 2004 19:19:13 +0100

Jonathan Morton wrote:
> Hmm.  I suspect a bug in the cpuid test, which I've corrected just now -
> the cpuid instruction clobbers several registers, which need to be
> accounted for along with the actual result code.

That fixed it.

> I did a minor optimisation that might remove a data-dependency stall
> between each round - it appears to be slightly faster on the Athlon, but
> no change on the Pentium-MMX.  I also updated the "MMX Compact" routine
> to use optimised assembly in the right places.  The latter is still a
> little slower than the MMX Standard routine on both my PCs, so I've
> moved it out of the "preferred" position in the list.

seems a little faster on P4; I also tried turning on -msse -msse2 for a
noticeable speed improvement even on assember versions:

-O3 -funroll-loops -march=pentium3 -mmmx
  1705904 ANSI Compact 1-pipe
  1487198 ANSI Standard 1-pipe
  2071455 ANSI Compact 2-pipe
  1611131 ANSI Standard 2-pipe
  2974397 AMD64/x86 MMX Compact 1x2-pipe
  3741983 AMD64/x86 MMX Standard 1x2-pipe *

-O3 -funroll-loops -march=pentium4 -mmmx
  1841293 ANSI Compact 1-pipe
  1468373 ANSI Standard 1-pipe
  2071455 ANSI Compact 2-pipe
  1589061 ANSI Standard 2-pipe
  2974397 AMD64/x86 MMX Compact 1x2-pipe
  3625046 AMD64/x86 MMX Standard 1x2-pipe *

-O3 -funroll-loops -march=pentium4 -mno-mmx
  1901663 ANSI Compact 1-pipe
  1432117 ANSI Standard 1-pipe
  2000025 ANSI Compact 2-pipe
  1589061 ANSI Standard 2-pipe
  2974397 AMD64/x86 MMX Compact 1x2-pipe
  3625046 AMD64/x86 MMX Standard 1x2-pipe *

-O3 -funroll-loops -march=pentium4 -mmmx -msse -msse2
  1841293 ANSI Compact 1-pipe
  1506512 ANSI Standard 1-pipe
  2109118 ANSI Compact 2-pipe
  1611131 ANSI Standard 2-pipe
  3052671 AMD64/x86 MMX Compact 1x2-pipe
  3866716 AMD64/x86 MMX Standard 1x2-pipe *

>> btw I was thinking it would be useful to have a selection of hardware
>> with linux shell accounts for people who are working on this.
> 
> Don't OSDL, or people like them, have a facility for that?

I was thinking of list members.  If I can fix up my DSL link/wifi-router
to be more reliable, eg my laptop.  I looked a bit and:

http://www.osdl.org/lab_activities/lab_projects/

sounds more kernel focussed.

Adam



Other related posts: