mirror of
https://github.com/m00natic/vlfi.git
synced 2025-03-31 16:08:05 +01:00
Fix write measuring and endless loop in nearby approximation.
This commit is contained in:
parent
facdb9f6bc
commit
48a014f3bc
@ -153,8 +153,8 @@ VEC is a vector of (mean time . count) elements ordered by size."
|
|||||||
"Save buffer and save time it takes.
|
"Save buffer and save time it takes.
|
||||||
START, END, APPEND, VISIT have same meaning as in `write-region'.
|
START, END, APPEND, VISIT have same meaning as in `write-region'.
|
||||||
SIZE is number of bytes that are saved."
|
SIZE is number of bytes that are saved."
|
||||||
(let ((time (car (write-region start end buffer-file-name
|
(let ((time (car (vlf-time (write-region start end buffer-file-name
|
||||||
append visit))))
|
append visit)))))
|
||||||
(vlf-tune-add-measurement vlf-tune-write-bps size time)))
|
(vlf-tune-add-measurement vlf-tune-write-bps size time)))
|
||||||
|
|
||||||
(defun vlf-tune-hexlify ()
|
(defun vlf-tune-hexlify ()
|
||||||
@ -192,7 +192,9 @@ SIZE is number of bytes that are saved."
|
|||||||
(1+ right-idx))
|
(1+ right-idx))
|
||||||
val (if (zerop val)
|
val (if (zerop val)
|
||||||
right
|
right
|
||||||
(/ (+ val right) 2)))))))
|
(/ (+ val right) 2))))))
|
||||||
|
(setq left-idx (1- left-idx)
|
||||||
|
right-idx (1+ right-idx)))
|
||||||
val))
|
val))
|
||||||
|
|
||||||
(defmacro vlf-tune-approximate (vec index)
|
(defmacro vlf-tune-approximate (vec index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user