pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/benchmarks/hbench Add patches in PR pkg/17941 from Dav...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b8faf93cd2b4
branches:  trunk
changeset: 490110:b8faf93cd2b4
user:      garbled <garbled%pkgsrc.org@localhost>
date:      Thu Mar 03 08:53:06 2005 +0000

description:
Add patches in PR pkg/17941 from David Laight.  Mostly performance
boosts, and a core dump fix.  Bumping rev to 2.

diffstat:

 benchmarks/hbench/Makefile         |   6 +++---
 benchmarks/hbench/distinfo         |   8 ++++++--
 benchmarks/hbench/patches/patch-al |  30 ++++++++++++++++++++++--------
 benchmarks/hbench/patches/patch-am |  14 ++++++++++++++
 benchmarks/hbench/patches/patch-an |  33 +++++++++++++++++++++++++++++++++
 benchmarks/hbench/patches/patch-ao |  33 +++++++++++++++++++++++++++++++++
 benchmarks/hbench/patches/patch-ap |  33 +++++++++++++++++++++++++++++++++
 7 files changed, 144 insertions(+), 13 deletions(-)

diffs (216 lines):

diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/Makefile
--- a/benchmarks/hbench/Makefile        Thu Mar 03 07:51:40 2005 +0000
+++ b/benchmarks/hbench/Makefile        Thu Mar 03 08:53:06 2005 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.28 2005/02/21 20:51:21 veego Exp $
+# $NetBSD: Makefile,v 1.29 2005/03/03 08:53:06 garbled Exp $
 
 DISTNAME=              hbench-OS-1.0
 PKGNAME=               hbench-1.0
-PKGREVISION=           1
+PKGREVISION=   2
 CATEGORIES=            benchmarks
-MASTER_SITES=          http://www.eecs.harvard.edu/vino/perf/hbench/
+MASTER_SITES=  http://www.eecs.harvard.edu/vino/perf/hbench/
 
 MAINTAINER=            root%garbled.net@localhost
 HOMEPAGE=              http://www.eecs.harvard.edu/vino/perf/hbench/
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/distinfo
--- a/benchmarks/hbench/distinfo        Thu Mar 03 07:51:40 2005 +0000
+++ b/benchmarks/hbench/distinfo        Thu Mar 03 08:53:06 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2005/02/22 21:16:36 agc Exp $
+$NetBSD: distinfo,v 1.7 2005/03/03 08:53:06 garbled Exp $
 
 SHA1 (hbench-1.0/hbench-OS-1.0.tar.gz) = b1a72287e2d04561141f296ba04d142f60152fe0
 RMD160 (hbench-1.0/hbench-OS-1.0.tar.gz) = 2e2702c035689e1dec39328e47dc9dc9ff558103
@@ -14,4 +14,8 @@
 SHA1 (patch-ai) = d59d05c9d73aa4c06f5ac5153a069694a4267fd1
 SHA1 (patch-aj) = 7bca0c1062626b5c03f04b7bce17f7c2d8c14231
 SHA1 (patch-ak) = 986d86c1b6d6850585cde8cb9ffd119fbe2351ee
-SHA1 (patch-al) = 1955e8477c42ed43a416a37ef5aec598dd0655da
+SHA1 (patch-al) = 53ac43ab3287f4ae7dc246aa9b047923e8acd8b6
+SHA1 (patch-am) = 1d58355f664879ccd8880a63f574388fb61c0780
+SHA1 (patch-an) = 4cb762c246cdde99a219b8a4de2d354f2b6abb85
+SHA1 (patch-ao) = 69c92f83d10f061f8f0aa05da860cfc5cf764859
+SHA1 (patch-ap) = 057465b9f89e76367781401d91b333679a651cb4
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/patches/patch-al
--- a/benchmarks/hbench/patches/patch-al        Thu Mar 03 07:51:40 2005 +0000
+++ b/benchmarks/hbench/patches/patch-al        Thu Mar 03 08:53:06 2005 +0000
@@ -1,8 +1,16 @@
-$NetBSD: patch-al,v 1.2 2001/09/22 20:47:15 jdolecek Exp $
-
---- src/bw_pipe.c.orig Fri Sep 21 18:39:15 2001
-+++ src/bw_pipe.c      Fri Sep 21 18:39:48 2001
-@@ -147,6 +147,8 @@ do_pipexfer(num_iter, t)
+# $NetBSD: patch-al,v 1.3 2005/03/03 08:53:06 garbled Exp $
+--- src/bw_pipe.c.orig 1997-06-26 17:34:33.000000000 -0700
++++ src/bw_pipe.c      2005-03-03 01:31:48.000000000 -0700
+@@ -134,7 +134,7 @@
+       }
+ 
+       /* Amount to transfer */
+-      todo = XFERUNIT * num_iter;
++      todo = XFERUNIT * num_iter + bufsize;
+       
+       /* Allocate buffer */
+       buf = (char *) malloc(bufsize);
+@@ -147,6 +147,8 @@
        /* Spawn off a writer, then time the read */
        switch (fork()) {
        case 0:                 /* writer */
@@ -11,16 +19,22 @@
                while ((done < todo) &&
                       ((n = write(pipes[1], buf, bufsize)) > 0))
                        done += n;
-@@ -159,6 +161,8 @@ do_pipexfer(num_iter, t)
+@@ -159,8 +161,13 @@
                /*NOTREACHED*/
                
        default:                /* reader */
 +              close(pipes[1]);
 +
                /* wait for writer */
-               sleep(1);
+-              sleep(1);
++              while ((done < bufsize) &&
++                      ((n = read(pipes[0], buf, bufsize - done)) > 0))
++                      done += n;
++
                
-@@ -168,6 +172,7 @@ do_pipexfer(num_iter, t)
+               start();        /* start timing */
+               while ((done < todo) &&
+@@ -168,6 +175,7 @@
                        done += n;
                *t = stop();    /* stop timing */
  
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/patches/patch-am
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/hbench/patches/patch-am        Thu Mar 03 08:53:06 2005 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: patch-am,v 1.1 2005/03/03 08:53:06 garbled Exp $
+--- ./src/lat_fs.c      Fri Jun 27 01:34:38 1997
++++ work/hbench-OS/src/lat_fs.c       Wed Aug 14 12:48:11 2002
+@@ -229,8 +229,8 @@
+       if (deldir == DEL_REVERSE) {
+               for (i = 0; i < (num_iter +1)/2; i++) {
+                       /* swap(filenames[i],filenames[numfiles - i]); */
+-                      tmp = filenames[num_iter - i];
+-                      filenames[num_iter - i] = filenames[i];
++                      tmp = filenames[num_iter - 1 - i];
++                      filenames[num_iter - 1 - i] = filenames[i];
+                       filenames[i] = tmp;
+               }
+       } else if (deldir == DEL_PSEUDORANDOM) {
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/patches/patch-an
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/hbench/patches/patch-an        Thu Mar 03 08:53:06 2005 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: patch-an,v 1.1 2005/03/03 08:53:06 garbled Exp $
+--- ./src/timing.c      Fri Jun 27 04:52:29 1997
++++ work/hbench-OS/src/timing.c       Wed Aug 14 14:11:22 2002
+@@ -201,19 +201,24 @@
+ #ifdef DEBUG
+       printf(">> %d iteration gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
+ #endif
+-      while ((time = ((float)rtntime)*clkmul) < 1000000.) {
+-              /* while less than one second */
+-              num <<= 1;
++      while ((time = ((float)rtntime)*clkmul) < 1000000./16) {
++              /* while less than 1/16 second */
++              num <<= 2;
+               if ((*workfn)(num, &rtntime) != 0) {
+                       num >>= 1;
+ #ifdef DEBUG
+-                      printf(">> backing off\n");
++                      printf(">> backing off to %d iterations\n", num);
+ #endif
+-                      break;
++                      return num;
+               }
+ #ifdef DEBUG
+               printf(">> %d iterations gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
+ #endif
++      }
++      while (time < 1000000.) {
++              /* while less than one second */
++              num <<= 1;
++              time *= 2;
+       }
+ #ifdef DEBUG
+       printf(">> Choosing %d iterations\n",num);
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/patches/patch-ao
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/hbench/patches/patch-ao        Thu Mar 03 08:53:06 2005 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: patch-ao,v 1.1 2005/03/03 08:53:06 garbled Exp $
+--- src/lat_ctx.c.orig 1997-06-26 17:34:37.000000000 -0700
++++ src/lat_ctx.c      2005-03-03 01:21:56.000000000 -0700
+@@ -63,6 +63,7 @@
+ pid_t pids[MAX_PROCS];        /* process ID's */
+ int   *pbuffer;               /* memory buffer for procs to sum */
+ int   *locdata;               /* proc's memory buffer for procs to sum */
++int   initial_niter;          /* number of iterations we were requesed to do */
+ 
+ int
+ main(ac, av)
+@@ -84,7 +85,7 @@
+       }
+ 
+       /* parse command line parameters */
+-      niter = atoi(av[1]);
++      initial_niter = niter = atoi(av[1]);
+       sprocs = parse_bytes(av[2]);
+       nprocs = atoi(av[3]);
+       
+@@ -276,6 +277,12 @@
+       int     i;
+       clk_t   val;
+ 
++      if (initial_niter == 0) {
++              /* We are only trying to find how many times to run the test */
++              do_overhead1(num_iter >> 1, t);
++              return 0;
++      }
++
+       centeravg_reset(OVERHEADAVG_LOOPS, OVERHEADAVG_TAILS);
+ 
+       for (i = OVERHEADAVG_LOOPS; i > 0; i--) {
diff -r 37deaa47b5df -r b8faf93cd2b4 benchmarks/hbench/patches/patch-ap
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/hbench/patches/patch-ap        Thu Mar 03 08:53:06 2005 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: patch-ap,v 1.1 2005/03/03 08:53:06 garbled Exp $
+--- src/lat_ctx2.c.orig        1997-06-26 17:34:37.000000000 -0700
++++ src/lat_ctx2.c     2005-03-03 01:21:59.000000000 -0700
+@@ -63,6 +63,7 @@
+ pid_t pids[MAX_PROCS];        /* process ID's */
+ int   *pbuffer;               /* memory buffer for procs to sum */
+ int   *locdata;               /* proc's memory buffer for procs to sum */
++int   initial_niter;          /* number of iterations we were requesed to do */
+ 
+ int
+ main(ac, av)
+@@ -84,7 +85,7 @@
+       }
+ 
+       /* parse command line parameters */
+-      niter = atoi(av[1]);
++      initial_niter = niter = atoi(av[1]);
+       sprocs = parse_bytes(av[2]);
+       nprocs = atoi(av[3]);
+       
+@@ -251,6 +252,12 @@
+       int     i;
+       clk_t   val;
+ 
++      if (initial_niter == 0) {
++              /* We are only trying to find how many times to run the test */
++              do_overhead1(num_iter >> 1, t);
++              return 0;
++      }
++
+       centeravg_reset(OVERHEADAVG_LOOPS, OVERHEADAVG_TAILS);
+ 
+       for (i = OVERHEADAVG_LOOPS; i > 0; i--) {



Home | Main Index | Thread Index | Old Index