[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 5651ee3 252/310: Rename vlf-tune-optimal to vlf-tun
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 5651ee3 252/310: Rename vlf-tune-optimal to vlf-tune-batch. |
Date: |
Sat, 28 Nov 2020 00:33:26 -0500 (EST) |
branch: externals/vlf
commit 5651ee3d61ab70697aea4b5a34aedafefc25acef
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Rename vlf-tune-optimal to vlf-tune-batch.
---
vlf-occur.el | 2 +-
vlf-search.el | 10 +++++-----
vlf-tune.el | 6 ++++--
vlf-write.el | 10 +++++-----
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/vlf-occur.el b/vlf-occur.el
index 809e42f..a867104 100644
--- a/vlf-occur.el
+++ b/vlf-occur.el
@@ -257,7 +257,7 @@ Prematurely ending indexing will still show what's found so
far."
total-matches))))))))
(setq end-of-file (= vlf-end-pos vlf-file-size))
(unless end-of-file
- (vlf-tune-optimal tune-types)
+ (vlf-tune-batch tune-types)
(let ((batch-move (- vlf-end-pos batch-step)))
(vlf-move-to-batch (if (or is-hexl
(< match-end-pos
diff --git a/vlf-search.el b/vlf-search.el
index 443276c..0c61898 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -74,7 +74,7 @@ Use existing REPORTER and start TIME if given."
(match-end 0)))))
((zerop vlf-start-pos)
(throw 'end-of-file nil))
- (t (vlf-tune-optimal tune-types)
+ (t (vlf-tune-batch tune-types)
(let ((batch-move (- vlf-start-pos
(- vlf-batch-size
batch-step))))
@@ -107,7 +107,7 @@ Use existing REPORTER and start TIME if given."
(match-end 0)))))
((= vlf-end-pos vlf-file-size)
(throw 'end-of-file nil))
- (t (vlf-tune-optimal tune-types)
+ (t (vlf-tune-batch tune-types)
(let ((batch-move (- vlf-end-pos batch-step)))
(vlf-move-to-batch
(if (or is-hexl
@@ -207,7 +207,7 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(time (float-time))
(success nil))
(font-lock-mode 0)
- (vlf-tune-optimal '(:raw))
+ (vlf-tune-batch '(:raw))
(unwind-protect
(if (< 0 n)
(let ((start 0)
@@ -228,7 +228,7 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(while (re-search-forward "[\n\C-m]" nil t)
(setq n (1- n)))
(vlf-verify-size)
- (vlf-tune-optimal '(:raw))
+ (vlf-tune-batch '(:raw))
(setq start end
end (min vlf-file-size
(+ start vlf-batch-size)))
@@ -254,7 +254,7 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(goto-char (point-max))
(while (re-search-backward "[\n\C-m]" nil t)
(setq n (1- n)))
- (vlf-tune-optimal '(:raw))
+ (vlf-tune-batch '(:raw))
(setq end start
start (max 0 (- end vlf-batch-size)))
(progress-reporter-update reporter
diff --git a/vlf-tune.el b/vlf-tune.el
index f65521c..b3dd425 100644
--- a/vlf-tune.el
+++ b/vlf-tune.el
@@ -311,12 +311,14 @@ optimizing over TYPES up to MAX-IDX."
(or (not none-missing)
(setq vlf-batch-size (* (1+ best-idx) vlf-tune-step)))))
-(defun vlf-tune-optimal (types &optional linear)
+(defun vlf-tune-batch (types &optional linear)
"Adjust `vlf-batch-size' to optimal value optimizing on TYPES.
TYPES is alist of elements that may be of form (type coef) or
non list values in which case coeficient is assumed 1.
Types can be :insert, :raw, :encode, :write, :hexl or :dehexlify.
-If LINEAR is non nil, use brute-force."
+If LINEAR is non nil, use brute-force. In case requested measurement
+is missing, stop search and set `vlf-batch-size' to this value.
+Suitable for multiple batch operations."
(if (eq vlf-tune-enabled t)
(let ((max-idx (1- (/ (min vlf-tune-max
(/ (1+ vlf-file-size) 2))
diff --git a/vlf-write.el b/vlf-write.el
index 5ef1d56..f15799a 100644
--- a/vlf-write.el
+++ b/vlf-write.el
@@ -78,7 +78,7 @@ If changing size of chunk, shift remaining file content."
(vlf-update-buffer-name)
(goto-char pos)))))
(if hexl (vlf-tune-hexlify)))
- (run-hook-with-args 'vlf-after-batch-functions 'write))
+ (run-hook-with-args 'vlf-after-batch-functions 'write))
t)
(defun vlf-file-shift-back (size-change write-size)
@@ -108,7 +108,7 @@ WRITE-SIZE is byte length of saved chunk."
back at WRITE-POS. Return nil if EOF is reached, t otherwise."
(erase-buffer)
(vlf-verify-size t)
- (vlf-tune-optimal '(:raw :write))
+ (vlf-tune-batch '(:raw :write))
(let ((read-end (min (+ read-pos vlf-batch-size) vlf-file-size)))
(vlf-tune-insert-file-contents-literally read-pos read-end)
(vlf-tune-write nil nil write-pos 0 (- read-end read-pos))
@@ -118,7 +118,7 @@ back at WRITE-POS. Return nil if EOF is reached, t
otherwise."
"Shift file contents SIZE-CHANGE bytes forward.
WRITE-SIZE is byte length of saved chunk.
Done by saving content up front and then writing previous batch."
- (vlf-tune-optimal '(:raw :write))
+ (vlf-tune-batch '(:raw :write))
(let ((read-size (max vlf-batch-size size-change))
(read-pos vlf-end-pos)
(write-pos vlf-start-pos)
@@ -128,7 +128,7 @@ Done by saving content up front and then writing previous
batch."
(vlf-with-undo-disabled
(when (vlf-shift-batches read-size read-pos write-pos
write-size t)
- (vlf-tune-optimal '(:raw :write))
+ (vlf-tune-batch '(:raw :write))
(setq write-pos (+ read-pos size-change)
read-pos (+ read-pos read-size)
write-size read-size
@@ -137,7 +137,7 @@ Done by saving content up front and then writing previous
batch."
(let ((coding-system-for-write 'no-conversion))
(while (vlf-shift-batches read-size read-pos write-pos
write-size nil)
- (vlf-tune-optimal '(:raw :write))
+ (vlf-tune-batch '(:raw :write))
(setq write-pos (+ read-pos size-change)
read-pos (+ read-pos read-size)
write-size read-size
- [elpa] externals/vlf 5d30eb4 206/310: Use single ediff pass to adjust borders. Protect against user, (continued)
- [elpa] externals/vlf 5d30eb4 206/310: Use single ediff pass to adjust borders. Protect against user, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ffac697 217/310: Keep undo list after occur or unsuccessful line search., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b05255b 220/310: Add hooks to run around chunk moves and batch operations. Don't err, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 557d751 236/310: Be more precise on restoring hexl-mode after chunk update has been, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ece554a 231/310: Wording., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 069b2f5 240/310: Replace operations with respective vlf-tune wrappers., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf fb05030 241/310: Add basic tune strategies., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e18a05b 247/310: Add linear search for tuning and prefer smaller batches., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 48a014f 250/310: Fix write measuring and endless loop in nearby approximation., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ee7409b 254/310: Tune batch size in more cases., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5651ee3 252/310: Rename vlf-tune-optimal to vlf-tune-batch.,
Stefan Monnier <=
- [elpa] externals/vlf 06b4f85 262/310: Respect disabled tune settings and move custom options., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 199209f 263/310: Fix vlf-tune-optimal-load with no optional arguments supplied., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 023ee70 267/310: Declare hexl functions to please byte compiler., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c3a308c 271/310: Optimize save performance over the temp file if such is used. Add, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ce13609 278/310: Fix vlf-ediff at the borders of hexl buffers., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f43ada1 282/310: Fix byte compilation warnings., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 305d802 280/310: Use shared profiling info for encode, write and hexl operations., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5dd9e2c 281/310: Adjust address parts of hexlified buffer according to vlf-start-pos., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 68d6c1b 289/310: vlf-occur changes:, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0fa6248 288/310: Optimize unconditional chunk loading and prefer it in more cases of, Stefan Monnier, 2020/11/28