|
From: <sv...@va...> - 2005-12-25 02:49:47
|
Author: njn
Date: 2005-12-25 02:49:45 +0000 (Sun, 25 Dec 2005)
New Revision: 5432
Log:
Merge r5431 (swizzle() speedup) from trunk.
Modified:
branches/COMPVBITS/coregrind/m_mallocfree.c
Modified: branches/COMPVBITS/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/coregrind/m_mallocfree.c 2005-12-25 02:47:12 UTC (=
rev 5431)
+++ branches/COMPVBITS/coregrind/m_mallocfree.c 2005-12-25 02:49:45 UTC (=
rev 5432)
@@ -696,7 +696,12 @@
if (p_best =3D=3D NULL) return;
=20
pn =3D pp =3D p_best;
- for (i =3D 0; i < 20; i++) {
+
+ // This loop bound was 20 for a long time, but experiments showed tha=
t
+ // reducing it to 10 gave the same result in all the tests, and 5 got=
the
+ // same result in 85--100% of cases. And it's called often enough to=
be
+ // noticeable in programs that allocated a lot.
+ for (i =3D 0; i < 5; i++) {
pn =3D get_next_b(pn);
pp =3D get_prev_b(pp);
if (pn < p_best) p_best =3D pn;
|