From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84018 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Optimize regexp build by Group Mail Splitting Date: Sat, 28 Dec 2013 04:53:37 +0100 Message-ID: <877gapocla.fsf@hati.baby-gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1388202858 10761 80.91.229.3 (28 Dec 2013 03:54:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Dec 2013 03:54:18 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32270@lists.math.uh.edu Sat Dec 28 04:54:24 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vwkyl-0004tX-G6 for ding-account@gmane.org; Sat, 28 Dec 2013 04:54:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1VwkyI-0008FD-9W; Fri, 27 Dec 2013 21:53:54 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1VwkyF-0008Ew-7O for ding@lists.math.uh.edu; Fri, 27 Dec 2013 21:53:51 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Vwky5-0002w0-0D for ding@lists.math.uh.edu; Fri, 27 Dec 2013 21:53:50 -0600 Original-Received: from zion.baby-gnu.net ([82.225.168.180] helo=zion.baby-gnu.org) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Vwky2-0005Zm-UQ for ding@gnus.org; Sat, 28 Dec 2013 04:53:39 +0100 Original-Received: from hati.asgardr.info ([192.168.1.2] helo=hati.baby-gnu.org) by zion.baby-gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1Vwky1-00052W-RH for ding@gnus.org; Sat, 28 Dec 2013 04:53:37 +0100 Organisation: Dark Church of Emacs Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84018 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Here is a patch[1] to optimize the regexps build by Group Mail Splitting. It's a little bit slower, as said in my tag message a 100 run benchmark on 44 mail groups managed by Group Mail Splitting result in: =2D master: Elapsed time: 2.205961s (0.792951s in 9 GCs) =2D master+patch: Elapsed time: 2.547914s (1.069562s in 12 GCs) Regards. The following changes since commit 934f25f8d8801afe315722fd0b0b4ea14bcb1534: Make split tracing work in nnimap groups, too (2013-12-26 17:39:39 +0100) are available in the git repository at: git://git.baby-gnu.net/gnus.git tags/feature/use-regexp-opt-in-gnus-group= -split-fancy for you to fetch changes up to 116ef38c9c0264d2f91b415d27bdece99118bd47: Optimize regexp build by Group Mail Splitting (2013-12-28 04:33:56 +0100) =2D--------------------------------------------------------------- Use =E2=80=9Cregexp-opt=E2=80=9D instead of building alternatives. A 100 run benchmark on 44 mail groups managed by Group Mail Splitting result in: =2D master: Elapsed time: 2.205961s (0.792951s in 9 GCs) =2D master+patch: Elapsed time: 2.547914s (1.069562s in 12 GCs) =2D--------------------------------------------------------------- Daniel Dehennin (1): Optimize regexp build by Group Mail Splitting lisp/gnus-mlspl.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el index 3947c67..5769dad 100644 =2D-- a/lisp/gnus-mlspl.el +++ b/lisp/gnus-mlspl.el @@ -179,22 +179,22 @@ Calling (gnus-group-split-fancy nil nil \"mail.others= \") returns: (split-regexp (cdr (assoc 'split-regexp params))) (split-exclude (cdr (assoc 'split-exclude params)))) (when (or to-address to-list extra-aliases split-regexp) =2D ;; regexp-quote to-address, to-list and extra-aliases =2D ;; and add them all to split-regexp + ;; regexp-opt to-address, to-list and extra-aliases + ;; and append split-regexp to the compiled regexp (setq split-regexp (concat "\\(" =2D (mapconcat =2D 'identity =2D (append =2D (and to-address (list (regexp-quote to-address))) =2D (and to-list (list (regexp-quote to-list))) =2D (and extra-aliases =2D (if (listp extra-aliases) =2D (mapcar 'regexp-quote extra-aliases) =2D (list extra-aliases))) =2D (and split-regexp (list split-regexp))) =2D "\\|") + (regexp-opt + (remove nil + (append + (list + to-address + to-list) + (if (listp extra-aliases) + extra-aliases + (list extra-aliases))))) + (if split-regexp + (concat "\\|" split-regexp)) "\\)")) ;; Now create the new SPLIT (push (append Footnotes:=20 [1] http://git.baby-gnu.net/gitweb/gitweb.cgi?p=3Dgnus.git;a=3Dtag;h=3Dref= s/tags/feature/use-regexp-opt-in-gnus-group-split-fancy =2D-=20 Daniel Dehennin R=C3=A9cup=C3=A9rer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREKAAYFAlK+S0EACgkQFrLRMcygGktkEAD/aba9e9dKA0yfQPfV2drYtGxA OurD6TsS4kWsJ3Edb5wA+gOqFD3XER5bqMK7kw0JSPTAJc0q0w+KyDZC7t/8A4lm =96Vh -----END PGP SIGNATURE----- --=-=-=--