unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 40c0124816: Minor improvements to precision scroll interpolation
@ 2022-07-30  5:58 Eli Zaretskii
  2022-07-30  7:03 ` Po Lu
  2022-07-30  7:27 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Eli Zaretskii @ 2022-07-30  5:58 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> --- a/lisp/pixel-scroll.el
> +++ b/lisp/pixel-scroll.el
> @@ -759,6 +759,9 @@ It is a vector of the form [ VELOCITY TIME SIGN ]."
>    (interactive "e")
>    (when pixel-scroll-precision-use-momentum
>      (let ((window (mwheel-event-window event))
> +          ;; The animations are smoother if the GC threshold is
> +          ;; reduced for the duration of the animation.
> +          (gc-cons-threshold (* gc-cons-threshold 3))
>            (state nil))

I don't think it is safe to multiply gc-cons-threshold without some
kind of limitation from above: the user or some Lisp program could
have increased the threshold already to a large value.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 40c0124816: Minor improvements to precision scroll interpolation
  2022-07-30  5:58 master 40c0124816: Minor improvements to precision scroll interpolation Eli Zaretskii
@ 2022-07-30  7:03 ` Po Lu
  2022-07-30  7:27 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Po Lu @ 2022-07-30  7:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> --- a/lisp/pixel-scroll.el
>> +++ b/lisp/pixel-scroll.el
>> @@ -759,6 +759,9 @@ It is a vector of the form [ VELOCITY TIME SIGN ]."
>>    (interactive "e")
>>    (when pixel-scroll-precision-use-momentum
>>      (let ((window (mwheel-event-window event))
>> +          ;; The animations are smoother if the GC threshold is
>> +          ;; reduced for the duration of the animation.
>> +          (gc-cons-threshold (* gc-cons-threshold 3))
>>            (state nil))
>
> I don't think it is safe to multiply gc-cons-threshold without some
> kind of limitation from above: the user or some Lisp program could
> have increased the threshold already to a large value.

Right, I see the problem.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 40c0124816: Minor improvements to precision scroll interpolation
  2022-07-30  5:58 master 40c0124816: Minor improvements to precision scroll interpolation Eli Zaretskii
  2022-07-30  7:03 ` Po Lu
@ 2022-07-30  7:27 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-07-30  7:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel

>> --- a/lisp/pixel-scroll.el
>> +++ b/lisp/pixel-scroll.el
>> @@ -759,6 +759,9 @@ It is a vector of the form [ VELOCITY TIME SIGN ]."
>>    (interactive "e")
>>    (when pixel-scroll-precision-use-momentum
>>      (let ((window (mwheel-event-window event))
>> +          ;; The animations are smoother if the GC threshold is
>> +          ;; reduced for the duration of the animation.
>> +          (gc-cons-threshold (* gc-cons-threshold 3))
>>            (state nil))
>
> I don't think it is safe to multiply gc-cons-threshold without some
> kind of limitation from above: the user or some Lisp program could
> have increased the threshold already to a large value.

And I also suspect the above won't be "sufficient" when the heap is
large, because in that case `gc-cons-threshold` doesn't have any effect
any more and it's `gc-cons-percentage` that matters instead.

Maybe binding `gc-cons-percentage` to something like the 1.0 value we
now use in batch mode (or rather to (max 1.0 gc-cons-percentage)) would
be a better option.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-30  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30  5:58 master 40c0124816: Minor improvements to precision scroll interpolation Eli Zaretskii
2022-07-30  7:03 ` Po Lu
2022-07-30  7:27 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).