emacs-devel
[Top][All Lists]
Advanced

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

Re: Pixel-based display functions


From: Eli Zaretskii
Subject: Re: Pixel-based display functions
Date: Fri, 06 Feb 2015 09:45:57 +0200

> From: Lars Ingebrigtsen <address@hidden>
> Cc: address@hidden, Eli Zaretskii <address@hidden>,
>         martin rudalics <address@hidden>
> Date: Fri, 06 Feb 2015 12:17:43 +1100
> 
> I've been doing some benchmarking to get a feel for the speed of
> `vertical-motion'.  
> 
> shr-tag-body                         100         2.2069731249  0.0220697312
> shr-fold-lines                       100         1.2538841410  0.0125388414
> shr-fold-line                        1500        1.2457802040  0.0008305201
> shr-goto-pixel-column                5000        1.1738643779  0.0002347728
> 
> `shr-goto-pixel-column' is just a call to `vertical-motion' separated
> out to see how much time it takes.
> 
> So, basically, folding 1500 lines takes 1.24s, of which 1.17s is spent
> in `vertical-motion' (plus function call overhead).  (It's called a lot
> of times because the lines are very long and need to be filled more than
> once.)

Can you explain why you need to call vertical-motion so many times?

> But it's all kinda moot since `window-text-pixel-size' doesn't work on
> non-displayed buffers (yet).

window-text-pixel-size is equivalent to vertical-motion, so I don't
understand why you need both.  Can you explain?

More generally, perhaps you could post an outline of your
algorithm(s), so that their overall design could be kept in mind.  It
just could be that the speedups you are looking for are on the
algorithm level, not on the level of primitives.

> I wonder whether a faster interface would be to have a version of
> `window-text-pixel-size' that returns a vector of glyph sizes.

??? Isn't that font-get-glyphs that you already tried?  If not, why
not?  What API would you like to have for that hypothetical function?

> Of course, computing the vector may be unreasonably slow.

It is again equivalent to vertical-motion and font-get-glyphs, so it's
not slow.  But I don't yet see the issue clearly enough to tell what
could be done for you, so please post more information about what you
are trying to do.



reply via email to

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