From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#40704: 28.0.50; Improve and speed up (Gnus) registry saving Date: Sun, 19 Apr 2020 21:13:45 -0700 Message-ID: <87pnc2lrpi.fsf@ericabrahamsen.net> References: <87a738ql1z.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74316"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40704@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 20 06:15:27 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQNqB-000JGi-Jd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Apr 2020 06:15:27 +0200 Original-Received: from localhost ([::1]:56982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQNq8-0001o0-BF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Apr 2020 00:15:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39366 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQNp0-0001me-9K for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 00:14:14 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQNos-00031m-LM for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 00:14:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34856) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQNos-0002zp-Az for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 00:14:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jQNoo-0002Cg-6l for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2020 00:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Apr 2020 04:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40704 X-GNU-PR-Package: emacs Original-Received: via spool by 40704-submit@debbugs.gnu.org id=B40704.15873560388454 (code B ref 40704); Mon, 20 Apr 2020 04:14:02 +0000 Original-Received: (at 40704) by debbugs.gnu.org; 20 Apr 2020 04:13:58 +0000 Original-Received: from localhost ([127.0.0.1]:46402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQNok-0002CH-7n for submit@debbugs.gnu.org; Mon, 20 Apr 2020 00:13:58 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:49010 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQNoh-0002C0-6w for 40704@debbugs.gnu.org; Mon, 20 Apr 2020 00:13:56 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B6D67FA099; Mon, 20 Apr 2020 04:13:46 +0000 (UTC) In-Reply-To: <87a738ql1z.fsf@web.de> (Michael Heerdegen's message of "Sun, 19 Apr 2020 04:14:00 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178697 Archived-At: Michael Heerdegen writes: > Hello, > > Saving the Gnus registry is quite slow currently. I profiled a bit and > for now suggest to do something like in the attached patch. In detail: > > (1) We need to bind inhibit-modification-hooks -> t, this offers a good > speedup (~ 4 or so). > > (2) Printing the registry which basically consists of huge hash tables, > causes a lot of garbage. Most of that garbage seems to be unavoidable > (is it created by the printing primitives?). Anyway, seems we should > temporarily increase `gc-cons-threshold' drastically, this offers > another speedup of 25% or so. The patch attached uses the value that > works well for me and the size of my registry, and I bind it in > `gnus-registry-save', because I assume other registries outside of Gnus > can be smaller. What would be a good value of `gc-cons-threshold', or > should it even scale with `gnus-registry-max-entries' instead of being > constant? > > (3) I also decided to change `eieio-override-prin1' to print hash tables > "by hand" from Lisp. The eieio-persistent requires to modify how > elements in the hash tables are printed, and the current way of doing > this (make a copy of the complete table, change the elements, prin1 and > re-read the result) is not only hackish but also inefficient (it does > this recursively for nested tables). > > Any comments on the suggested changes? Not that it's up to me, but I'm all for putting in #1 and #3 as-is, and adjusting #2 to scale with the number of `gnus-registry-max-entries', with the addition of a hard ceiling. Eric