emacs-devel
[Top][All Lists]
Advanced

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

Re: master 4b5d04b: Use new macro debounce-reduce to make mouse scaling


From: Juri Linkov
Subject: Re: master 4b5d04b: Use new macro debounce-reduce to make mouse scaling of images more responsive
Date: Thu, 28 Nov 2019 01:59:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>>>                            #'image--change-size
>>>                            (if n
>>>                                (- 1 (/ (prefix-numeric-value n) 10.0))
>>>                              0.8)))
>> This version doesn't discard a sequence of consecutive calls
>> where every call is a costly operation.  For example, on slow hardware
>> every image resize takes about 1 sec.
>
> I understand that but I don't see why you connect the two:
> AFAICT `image--change-size` is a very lightweight function which just
> changes one value in a plist.  The costly operation happens later during
> redisplay.  So if those consecutive calls happen without any redisplay
> between them, you should pay for the costly operation only once.
>
>> Thus when mouse-wheel generates 5 events, this version will wait for
>> the next idle time, then will resize the image sequentially 5 times
>> during 5 seconds.
>
> I would expect that after the idle time it will call
> `image--change-size` five times and then perform one costly
> recomputation with the resulting new size.

I didn't expect that the display engine is optimized to handle this case.
Eli asked to try to bind redisplay-dont-pause to nil, then I tried, but
redisplay-dont-pause has no effect.

But it seems run-with-idle-timer could help.  Not sure how I could confirm
that no images are created for intermediate scaling factors, but if visually
it feels more responsive, then run-with-idle-timer should be used.



reply via email to

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