pkgsrc/benchmarks/hbench/patches/patch-an
garbled 314ae767c7 Add patches in PR pkg/17941 from David Laight. Mostly performance
boosts, and a core dump fix.  Bumping rev to 2.
2005-03-03 08:53:06 +00:00

33 lines
980 B
Text

# $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);