emacs-devel
[Top][All Lists]
Advanced

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

Re: Pixel-based display functions


From: Lars Ingebrigtsen
Subject: Re: Pixel-based display functions
Date: Tue, 10 Feb 2015 17:07:33 +1100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

> I'll apply the shr branch stuff to the trunk later today and post some
> new ELP traces with the new `vertical-motion' speedups.

Here's the output when not giving the col number to `vertical-motion',
and starting from the second character on the line:

shr-insert-document                  1           2.545489884   2.545489884
shr-pixel-buffer-width               1018        0.7405463030  0.0007274521
shr-vertical-motion                  1993        0.2620109859  0.0001314656

Here's when giving a 0 argument, and starting from `beginning-of-line':

shr-insert-document                  1           4.449059093   4.449059093
shr-vertical-motion                  1993        2.1624376150  0.0010850163
shr-pixel-buffer-width               1018        0.7389822159  0.0007259157

So this is apparently 10x slower now?

Uhm...

Could there be an issue with the new code being slower when the buffer
in question isn't being displayed?

These are the two versions of the function being used, with the first
one being 10x slower than the second.

(defun shr-vertical-motion (column)
  (if (not shr-use-fonts)
      (move-to-column column)
    (beginning-of-line)
    (vertical-motion (cons (/ column (frame-char-width)) 0) nil 0)
    (unless (eolp)
      (forward-char 1))))

(defun shr-vertical-motion (column)
  (if (not shr-use-fonts)
      (move-to-column column)
    (beginning-of-line)
    (unless (eolp)
      (forward-char 1))
    (vertical-motion (cons (/ column (frame-char-width)) 0))
    (unless (eolp)
      (forward-char 1))))



-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



reply via email to

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