emacs-devel
[Top][All Lists]
Advanced

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

Re: Region cache for bidi paragraphs?


From: Dmitry Antipov
Subject: Re: Region cache for bidi paragraphs?
Date: Mon, 05 Aug 2013 09:26:37 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

On 08/02/2013 06:03 PM, Eli Zaretskii wrote:

Does it give any real speedup, and if so, in what use cases?

My benchmarks was:

;; 0
(defun scroll-both ()
  (interactive)
  (let ((start (float-time)))
    (progn
      (goto-char (point-min))
      (dotimes (n 500) (progn (scroll-up) (redisplay)))
      (goto-char (point-max))
      (dotimes (n 500) (progn (scroll-down) (redisplay)))
      (message "Elapsed %f seconds" (- (float-time) start)))))

;; 1
(defun scroll-both-line ()
  (interactive)
  (let ((start (float-time)))
    (progn
      (goto-char (point-min))
      (dotimes (n 5000) (progn (forward-line 1) (redisplay)))
      (goto-char (point-max))
      (dotimes (n 5000) (progn (forward-line -1) (redisplay)))
      (message "Elapsed %f seconds" (- (float-time) start)))))

Input 0: xdisp.c
Input 1: ASCII text 30K lines, 1000chr/line, no paragraph separators
Input 2: ASCII text 30K lines, 1000chr/line, paragraph separator after each line

Time is in seconds as reported, smaller is better.

Input  0        1        0 cached 1 cached
-------+--------+--------+--------+-------
0      30.2     12.7     30.4     12.7
1      11.1     34.5     6.4      15.3
2      6.0      13.1     5.2      13.1
------------------------------------------

I.e. longer lines and smaller amount of paragraph separators =>
more benefits from using region cache.

Dmitry
.




reply via email to

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