Author: Armin Rigo <[email protected]>
Branch: reverse-debugger
Changeset: r85102:5a6c8b6f60a8
Date: 2016-06-11 21:50 +0200
http://bitbucket.org/pypy/pypy/changeset/5a6c8b6f60a8/

Log:    Tweak the ratio

diff --git a/rpython/translator/revdb/rdb-src/revdb.c 
b/rpython/translator/revdb/rdb-src/revdb.c
--- a/rpython/translator/revdb/rdb-src/revdb.c
+++ b/rpython/translator/revdb/rdb-src/revdb.c
@@ -200,7 +200,7 @@
 */
 
 #define NUM_FROZEN_PROCESSES   30
-#define GOLDEN_RATIO           0.618034
+#define STEP_RATIO             0.25
 
 #define RD_SIDE   0
 #define WR_SIDE   1
@@ -624,9 +624,14 @@
     }
     else {
         /* in the main process: continue reloading the revdb log */
-        uint64_t delta = total_stop_points - rpy_revdb.stop_point_break;
-        delta = (uint64_t)(delta * (1 - GOLDEN_RATIO));
-        if (delta == 0 || frozen_num_pipes == NUM_FROZEN_PROCESSES - 1)
+        uint64_t remaining = total_stop_points - rpy_revdb.stop_point_break;
+        uint64_t delta;
+        double step = STEP_RATIO;
+        int remaining_freezes = NUM_FROZEN_PROCESSES - frozen_num_pipes;
+        if (step * remaining_freezes < 1.0)
+            step = 1.0 / remaining_freezes;
+        delta = (uint64_t)(remaining * step);
+        if (delta == 0 || delta > remaining || remaining_freezes == 1)
             rpy_revdb.stop_point_break = total_stop_points;
         else
             rpy_revdb.stop_point_break += delta;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to