emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/vlf d579b7b 279/310: Workaround local maximum in batch


From: Stefan Monnier
Subject: [elpa] externals/vlf d579b7b 279/310: Workaround local maximum in batch tune.
Date: Sat, 28 Nov 2020 00:33:31 -0500 (EST)

branch: externals/vlf
commit d579b7b3e2604d839aea0e0c57dfb3e1fda3fc76
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Workaround local maximum in batch tune.
---
 vlf-tune.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/vlf-tune.el b/vlf-tune.el
index 08bdd9d..99c59dd 100644
--- a/vlf-tune.el
+++ b/vlf-tune.el
@@ -365,13 +365,17 @@ Suitable for multiple batch operations."
       (let ((max-idx (1- (/ (min vlf-tune-max
                                  (/ (1+ vlf-file-size) 2))
                             vlf-tune-step))))
-        (cond (linear (vlf-tune-linear types max-idx))
-              ((file-remote-p (or file buffer-file-name))
-               (vlf-tune-conservative types))
-              ((<= 1 max-idx)
-               (if (< max-idx 3)
-                   (vlf-tune-conservative types (/ max-idx 2))
-                 (vlf-tune-binary types 0 max-idx)))))))
+        (if linear
+            (vlf-tune-linear types max-idx)
+          (let ((batch-size vlf-batch-size))
+            (cond ((file-remote-p (or file buffer-file-name))
+                   (vlf-tune-conservative types))
+                  ((<= 1 max-idx)
+                   (if (< max-idx 3)
+                       (vlf-tune-conservative types (/ max-idx 2))
+                     (vlf-tune-binary types 0 max-idx))))
+            (if (= batch-size vlf-batch-size) ;local maxima?
+                (vlf-tune-linear types max-idx)))))))
 
 (defun vlf-tune-optimal-load (types &optional min-idx max-idx)
   "Get best batch size according to existing measurements over TYPES.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]