Gnus development mailing list
 help / color / mirror / Atom feed
* gnus registry takes 21 seconds to save and I can't prune it
@ 2020-03-18 12:57 Rémi Letot
  2020-03-18 16:04 ` Eric S Fraga
  2020-03-18 17:58 ` Eric Abrahamsen
  0 siblings, 2 replies; 6+ messages in thread
From: Rémi Letot @ 2020-03-18 12:57 UTC (permalink / raw)
  To: ding

Hello,

I have noticed quite a few slowdowns in my emacs for some times, but it
never became annoying enough for me to investigate.

Until now :-)

Starting emacs, gnus, or quitting them has become annoyingly long. It is
not really problematic because I leave emacs/gnus on for weeks at a
time, but still. Besides, pressing s in the group buffer is far too long
to be comfortable.

So, I diagnosed it to gnus-registry-save taking 21 seconds. 

I tried to see what happens in there, and noticed that I could set
gnus-registry-max-entries to a sensible number, but then I get an error
whenever I try to prune the registry (meaning as soon as I try to do
anything in gnus).

The error is "cl-some: Wrong type argument: listp, quote".

That happens in registry-collect-prune-candidates, on the "(memq (car
entry-key) precious)))" line, but there stops my lisp and edebug foo.

In short: can anyone help ? :-)
-- 
Rémi



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

* Re: gnus registry takes 21 seconds to save and I can't prune it
  2020-03-18 12:57 gnus registry takes 21 seconds to save and I can't prune it Rémi Letot
@ 2020-03-18 16:04 ` Eric S Fraga
  2020-03-18 17:58 ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2020-03-18 16:04 UTC (permalink / raw)
  To: ding

On Wednesday, 18 Mar 2020 at 13:57, Rémi Letot wrote:
> Starting emacs, gnus, or quitting them has become annoyingly long. It is
> not really problematic because I leave emacs/gnus on for weeks at a
> time, but still. Besides, pressing s in the group buffer is far too long
> to be comfortable.
>
> So, I diagnosed it to gnus-registry-save taking 21 seconds. 

I've noticed this recently as well.  Looking at the git logs, nothing
seems to have changed recently that would account for this.  I put it
down to my registry getting large enough now for the processing to be
significant (I have around 12k entries with max allowed of 20k).  I've
not tried pruning.

-- 
Eric S Fraga via Emacs 28.0.50 & org 9.3.6 on Debian bullseye/sid



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

* Re: gnus registry takes 21 seconds to save and I can't prune it
  2020-03-18 12:57 gnus registry takes 21 seconds to save and I can't prune it Rémi Letot
  2020-03-18 16:04 ` Eric S Fraga
@ 2020-03-18 17:58 ` Eric Abrahamsen
  2020-03-18 22:24   ` Bob Newell
  2020-03-19 17:39   ` hobbes
  1 sibling, 2 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2020-03-18 17:58 UTC (permalink / raw)
  To: Rémi Letot; +Cc: ding

hobbes@poukram.net (Rémi Letot) writes:

> Hello,
>
> I have noticed quite a few slowdowns in my emacs for some times, but it
> never became annoying enough for me to investigate.
>
> Until now :-)
>
> Starting emacs, gnus, or quitting them has become annoyingly long. It is
> not really problematic because I leave emacs/gnus on for weeks at a
> time, but still. Besides, pressing s in the group buffer is far too long
> to be comfortable.
>
> So, I diagnosed it to gnus-registry-save taking 21 seconds. 
>
> I tried to see what happens in there, and noticed that I could set
> gnus-registry-max-entries to a sensible number, but then I get an error
> whenever I try to prune the registry (meaning as soon as I try to do
> anything in gnus).
>
> The error is "cl-some: Wrong type argument: listp, quote".

Slow saving is a separate issue, and one that annoys a lot of people,
but this error sounds a lot like something that was going on a year or
more ago. If it's the same thing, there ought to be a solution:

1. Shut down Gnus
2. Back up your registry file
3. Start Gnus again
4. Eval the code below
5. Run M-x gnus-registry-fixit
6. Save Gnus

With any luck that will resolve the error.

(defun gnus-registry-strip-quotes (lst)
  (let (acc)
    (when (consp lst)
      (while (eq (car lst) 'quote)
	(setq lst (cadr lst)))
      (while (consp lst)
	(if (eq (car lst) 'quote)
	    (setq lst (cadr lst))
	  (push (gnus-registry-strip-quotes (car lst)) acc)
	  (setq lst (cdr lst)))))
    (nconc (nreverse (delete-dups acc))
	   lst)))

(defun gnus-registry-fixit ()
  "Fix Gnus registry after eieio-persistent patches.
For use with Emacs master branch, after installing 0afb43eeb, or
the 26 branch, after daa9e853bd."
  (interactive)
  (unless (gnus-alive-p)
    (gnus))
  (when gnus-registry-enabled
    (with-slots (tracker data) gnus-registry-db
      (maphash
       (lambda (track-sym hsh)
	 (maphash
	  (lambda (k v)
	    (setf (gethash k hsh)
		  (gnus-registry-strip-quotes v)))
	  hsh))
       tracker)
      (maphash
       (lambda (k v)
	 (setf (gethash k data) (gnus-registry-strip-quotes v)))
       data))))   


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

* Re: gnus registry takes 21 seconds to save and I can't prune it
  2020-03-18 17:58 ` Eric Abrahamsen
@ 2020-03-18 22:24   ` Bob Newell
  2020-03-18 23:17     ` Eric Abrahamsen
  2020-03-19 17:39   ` hobbes
  1 sibling, 1 reply; 6+ messages in thread
From: Bob Newell @ 2020-03-18 22:24 UTC (permalink / raw)
  To: The Gnus

I remember encountering this a year ago (maybe more or less, I didn't
look it up), and coming up with a kludge solution, which Eric replaced
with his far nicer code. It definitely works and makes things usable
again. I run gnus-registry-fixit automatically on Emacs shutdown.

--
Bob Newell
Via Linux/Emacs/Gnus/BBDB.


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

* Re: gnus registry takes 21 seconds to save and I can't prune it
  2020-03-18 22:24   ` Bob Newell
@ 2020-03-18 23:17     ` Eric Abrahamsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2020-03-18 23:17 UTC (permalink / raw)
  To: Bob Newell; +Cc: The Gnus

Bob Newell <bobnewell@bobnewell.net> writes:

> I remember encountering this a year ago (maybe more or less, I didn't
> look it up), and coming up with a kludge solution, which Eric replaced
> with his far nicer code. It definitely works and makes things usable
> again. I run gnus-registry-fixit automatically on Emacs shutdown.

You shouldn't need to keep running it! Once you're past 0afb43eeb on
Emcas 27, or after daa9e853b on Emacs 26, you should only have to run it
once -- the problem won't return.

(And if you find saving the registry is annoyingly slow, this will make
it worse!)


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

* Re: gnus registry takes 21 seconds to save and I can't prune it
  2020-03-18 17:58 ` Eric Abrahamsen
  2020-03-18 22:24   ` Bob Newell
@ 2020-03-19 17:39   ` hobbes
  1 sibling, 0 replies; 6+ messages in thread
From: hobbes @ 2020-03-19 17:39 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

>
> Slow saving is a separate issue, and one that annoys a lot of people,
> but this error sounds a lot like something that was going on a year or
> more ago. If it's the same thing, there ought to be a solution:
>
> 1. Shut down Gnus
> 2. Back up your registry file
> 3. Start Gnus again
> 4. Eval the code below
> 5. Run M-x gnus-registry-fixit
> 6. Save Gnus
>
> With any luck that will resolve the error.

it did, and my gnus-registry is now pruned at 30M. Still slow, but a lot
more manageable, thanks :-)

-- 
Rémi Letot



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

end of thread, other threads:[~2020-03-19 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 12:57 gnus registry takes 21 seconds to save and I can't prune it Rémi Letot
2020-03-18 16:04 ` Eric S Fraga
2020-03-18 17:58 ` Eric Abrahamsen
2020-03-18 22:24   ` Bob Newell
2020-03-18 23:17     ` Eric Abrahamsen
2020-03-19 17:39   ` hobbes

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 NNTP newsgroup(s).