[hashcash] Re: Hashcash performance improvements

  • From: Adam Back <adam@xxxxxxxxxxxxxxx>
  • To: hashcash@xxxxxxxxxxxxx
  • Date: Thu, 27 May 2004 14:05:19 -0400

On Thu, May 27, 2004 at 06:29:15PM +0100, Jonathan Morton wrote:
> What optimisation flags are you using?  As a Gentoo user, I tune my 
> flags to match each machine I test on:
> Athlon:   -O3 -funroll-loops -march=athlon-xp
> P-MMX:    -O3 -funroll-loops -march=pentium-mmx  <-- this is reasonably 
> generic
> G4:       -O2 -fno-schedule-insns -mcpu=7450

Was just -O, here's:

Pentium4: -O3 -funroll-loops -march=pentium4

    Rate  Name (* machine default)
  1788576 ANSI Compact 1-pipe *
  1471248 ANSI Standard 1-pipe
Best minter: ANSI Compact 1-pipe (1788576 hashes/sec)

Confirming as usual that the athlon rocks compared to P4.  (1.6Gz
athlon-XP toasting a 3.06Ghz P4, my machine is a P4, not a xeon).

Kind of reversing, and improving upon a bit the -O version:

  1520290 ANSI Compact 1-pipe *
  1689211 ANSI Standard 1-pipe

> I strongly suggest overhauling timer.c - ATM it uses "wall time" 
> instead of "CPU time", which is probably where a lot of the variance 
> comes from, and it has rather low resolution on some machines.  I use 
> clock() in my code, which tends to have at least 1/60 sec resolution, 
> and works on CPU time rather than wall time.  

Well I'd sooner have really high resolution so I do not have to run
code for long, chewing of real-time during minting to estimate speed.
I presume in practice it is a lot better than 1/60 sec?

The other aspect of course is that clock is CPU time which as you say
is what you actually want rather than wall-clock time.


Other related posts: