From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
Subject: Re: master 4b5d04b: Use new macro debounce-reduce to make mouse scaling of images more responsive
Date: Wed, 27 Nov 2019 17:55:19 -0500 [thread overview]
Message-ID: <jwvfti9nda8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87d0dd0yu1.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 27 Nov 2019 23:54:46 +0200")
>> #'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.
Stefan
next prev parent reply other threads:[~2019-11-27 22:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191123222254.31152.57547@vcs0.savannah.gnu.org>
[not found] ` <20191123222259.56FE420BE9@vcs0.savannah.gnu.org>
2019-11-24 0:40 ` master 4b5d04b: Use new macro debounce-reduce to make mouse scaling of images more responsive Stefan Monnier
2019-11-26 22:10 ` Juri Linkov
2019-11-27 3:32 ` Stefan Monnier
2019-11-27 21:54 ` Juri Linkov
2019-11-27 22:55 ` Stefan Monnier [this message]
2019-11-27 23:59 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvfti9nda8.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.