all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Slow redisplay
@ 2019-08-25 10:32 Ergus via Users list for the GNU Emacs text editor
  2019-08-25 11:10 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Ergus via Users list for the GNU Emacs text editor @ 2019-08-25 10:32 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

Hi:

With the actual master branch I am observing a very important lagging in
redisplay after being using emacs for 3-4 of hours. The rediplay happens
like in stop motion speed, I can see the redisplay line being updated
slowly and it takes sometimes like 1 seconds (from the top to the bottom
of the screen) in my best laptop.

(I only use emacs in tui) So the only solution after a while is to close
emacs and reopen again.

I used to have these lines:

(defun my/minibuffer-setup-hook ()
  (setq gc-cons-threshold most-positive-fixnum))

(defun my/minibuffer-exit-hook ()
  (setq gc-cons-threshold 800000))

(add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)

In my config, but after removing them (because someone suggested that
the redisplay lagging could be related with the gc) the problem is still
there (less critical, but still there after some hours).

Any suggestion to find where is the issue comming from? Or what should I
see to make a better report?

In-Reply-To: <20190824213001.GC17256@protected.rcdrun.com>

On Sat, Aug 24, 2019 at 11:30:01PM +0200, Jean Louis wrote:
>* Eli Zaretskii <eliz@gnu.org> [2019-08-24 21:04]:
>> > Date: Sat, 24 Aug 2019 20:50:46 +0200
>> > From: Jean Louis <bugs@gnu.support>
>> > Cc: help-gnu-emacs@gnu.org
>> >
>> > * Eli Zaretskii <eliz@gnu.org> [2019-08-24 20:26]:
>> > > > Date: Sat, 24 Aug 2019 19:37:11 +0200
>> > > > From: Jean Louis <bugs@gnu.support>
>> > > > Cc: GNU Emacs Help <help-gnu-emacs@gnu.org>
>> > > >
>> > > > - use simple editing of buffer with kill-buffer-hook, if I can come
>> > > >   back to initial program execution, as program execution must be wait
>> > > >   for editing to finish, I do not know how
>> > >
>> > > A command such as "M-x loop-continue" (possibly bound globally to some
>> > > key sequence) should be enough to resolve the "come back to initial
>> > > program execution" part.
>> >
>> > I do not have loop-continue, is it in some package?
>>
>> That's a command you need to write.  It is supposed to go to the next
>> field and generate a buffer for the user to edit that field.
>
>I know what you mean. But command that handles next fields is in
>the depth 0, I just need to return to senior function, or find
>way how to wait on find-file
>
>Jean
>



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

* Re: Slow redisplay
  2019-08-25 10:32 Slow redisplay Ergus via Users list for the GNU Emacs text editor
@ 2019-08-25 11:10 ` Eli Zaretskii
  2019-08-26  4:20   ` Ergus
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2019-08-25 11:10 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 25 Aug 2019 12:32:51 +0200
> From: Ergus <spacibba@aol.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
> 
> With the actual master branch I am observing a very important lagging in
> redisplay after being using emacs for 3-4 of hours. The rediplay happens
> like in stop motion speed, I can see the redisplay line being updated
> slowly and it takes sometimes like 1 seconds (from the top to the bottom
> of the screen) in my best laptop.
> 
> (I only use emacs in tui) So the only solution after a while is to close
> emacs and reopen again.
> 
> I used to have these lines:
> 
> (defun my/minibuffer-setup-hook ()
>   (setq gc-cons-threshold most-positive-fixnum))
> 
> (defun my/minibuffer-exit-hook ()
>   (setq gc-cons-threshold 800000))
> 
> (add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
> (add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)
> 
> In my config, but after removing them (because someone suggested that
> the redisplay lagging could be related with the gc) the problem is still
> there (less critical, but still there after some hours).
> 
> Any suggestion to find where is the issue comming from? Or what should I
> see to make a better report?

If you set garbage-collection-messages non-nil, do you see any GC
messages when Emacs is lagging input?  If so, does invoking "M-x
garbage-collect RET" manual fix that?



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

* Re: Slow redisplay
  2019-08-25 11:10 ` Eli Zaretskii
@ 2019-08-26  4:20   ` Ergus
  2019-08-26  7:42     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Ergus @ 2019-08-26  4:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sun, Aug 25, 2019 at 02:10:09PM +0300, Eli Zaretskii wrote:
>> Date: Sun, 25 Aug 2019 12:32:51 +0200
>> From: Ergus <spacibba@aol.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
>>
>> With the actual master branch I am observing a very important lagging in
>> redisplay after being using emacs for 3-4 of hours. The rediplay happens
>> like in stop motion speed, I can see the redisplay line being updated
>> slowly and it takes sometimes like 1 seconds (from the top to the bottom
>> of the screen) in my best laptop.
>>
>> (I only use emacs in tui) So the only solution after a while is to close
>> emacs and reopen again.
>>
>> I used to have these lines:
>>
>> (defun my/minibuffer-setup-hook ()
>>   (setq gc-cons-threshold most-positive-fixnum))
>>
>> (defun my/minibuffer-exit-hook ()
>>   (setq gc-cons-threshold 800000))
>>
>> (add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
>> (add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)
>>
>> In my config, but after removing them (because someone suggested that
>> the redisplay lagging could be related with the gc) the problem is still
>> there (less critical, but still there after some hours).
>>
>> Any suggestion to find where is the issue comming from? Or what should I
>> see to make a better report?
>
>If you set garbage-collection-messages non-nil, do you see any GC
>messages when Emacs is lagging input?

No there is not any garbage collection message after 5 hours.

>If so, does invoking "M-x
>garbage-collect RET" manual fix that?
>
Yes, executing it manually fixes the lagging.

In my config I do.

early-init.el
=============

(setq file-name-handler-alist nil
      message-log-max 16384
      gc-cons-threshold most-positive-fixnum   ;; Defer Garbage collection
      gc-cons-percentage 1.0)

(add-hook 'window-setup-hook
          (lambda ()
            (setq file-name-handler-alist file-name-handler-alist-old
                  gc-cons-threshold 800000
                  gc-cons-percentage 0.1)
	    (garbage-collect)
	    (message "Load time %.06f" (float-time (time-since my/start-time))))
	  t)

init.el
=======

(defun my/minibuffer-setup-hook ()
  (setq gc-cons-threshold most-positive-fixnum))

(defun my/minibuffer-exit-hook ()
  (setq gc-cons-threshold 800000))

(add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)

================

When I actually check the variables gc-cons-threshold they are updated
properly when minibuffer is active and when not.

But it seems that the gc is not triggered because I don't see any gc
message after 5 hours and the screen is already lagging.





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

* Re: Slow redisplay
  2019-08-26  4:20   ` Ergus
@ 2019-08-26  7:42     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2019-08-26  7:42 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 26 Aug 2019 06:20:41 +0200
> From: Ergus <spacibba@aol.com>
> Cc: help-gnu-emacs@gnu.org
> 
> >If you set garbage-collection-messages non-nil, do you see any GC
> >messages when Emacs is lagging input?
> 
> No there is not any garbage collection message after 5 hours.
> 
> >If so, does invoking "M-x
> >garbage-collect RET" manual fix that?
> >
> Yes, executing it manually fixes the lagging.
> 
> In my config I do.
> 
> early-init.el
> =============
> 
> (setq file-name-handler-alist nil
>       message-log-max 16384
>       gc-cons-threshold most-positive-fixnum   ;; Defer Garbage collection
>       gc-cons-percentage 1.0)
> 
> (add-hook 'window-setup-hook
>           (lambda ()
>             (setq file-name-handler-alist file-name-handler-alist-old
>                   gc-cons-threshold 800000
>                   gc-cons-percentage 0.1)
> 	    (garbage-collect)
> 	    (message "Load time %.06f" (float-time (time-since my/start-time))))
> 	  t)
> 
> init.el
> =======
> 
> (defun my/minibuffer-setup-hook ()
>   (setq gc-cons-threshold most-positive-fixnum))
> 
> (defun my/minibuffer-exit-hook ()
>   (setq gc-cons-threshold 800000))
> 
> (add-hook 'minibuffer-setup-hook #'my/minibuffer-setup-hook)
> (add-hook 'minibuffer-exit-hook #'my/minibuffer-exit-hook)
> 
> ================

There's currently an unfixed bug on master, whereby you must call
garbage-collect explicitly when you reset gc-cons-threshold to a value
lower than most-positive-fixnum.  Otherwise GC remains disabled
basically forever.



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

end of thread, other threads:[~2019-08-26  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-25 10:32 Slow redisplay Ergus via Users list for the GNU Emacs text editor
2019-08-25 11:10 ` Eli Zaretskii
2019-08-26  4:20   ` Ergus
2019-08-26  7:42     ` Eli Zaretskii

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.