From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84105 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Optimize regexp build by Group Mail Splitting Date: Fri, 31 Jan 2014 16:17:44 -0800 Message-ID: <877g9fit3r.fsf@building.gnus.org> References: <877gapocla.fsf@hati.baby-gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391213940 26479 80.91.229.3 (1 Feb 2014 00:19:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Feb 2014 00:19:00 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32357@lists.math.uh.edu Sat Feb 01 01:19:06 2014 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 1W9OIa-0000Bw-Fq for ding-account@gmane.org; Sat, 01 Feb 2014 01:19:04 +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 1W9OIP-0003Mp-8H; Fri, 31 Jan 2014 18:18:53 -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 1W9OIN-0003Md-Jq for ding@lists.math.uh.edu; Fri, 31 Jan 2014 18:18: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 1W9OIM-0003tJ-ID for ding@lists.math.uh.edu; Fri, 31 Jan 2014 18:18:51 -0600 Original-Received: from hermes.netfonds.no ([80.91.224.195]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1W9OIL-0002R5-1y for ding@gnus.org; Sat, 01 Feb 2014 01:18:49 +0100 Original-Received: from [204.14.154.233] (helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W9OI6-0005Mz-Uz for ding@gnus.org; Sat, 01 Feb 2014 01:18:35 +0100 In-Reply-To: <877gapocla.fsf@hati.baby-gnu.org> (Daniel Dehennin's message of "Sat, 28 Dec 2013 04:53:37 +0100") User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1W9OI6-0005Mz-Uz MailScanner-NULL-Check: 1391818716.00994@13xY4ZtVmXlola9v85wVwQ X-Spam-Status: No X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84105 Archived-At: Daniel Dehennin writes: > 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: > > - master: Elapsed time: 2.205961s (0.792951s in 9 GCs) > > - master+patch: Elapsed time: 2.547914s (1.069562s in 12 GCs) Hm... I'm not quite sure I understand the patch. > (setq split-regexp > (concat > "\\(" > - (mapconcat > - 'identity [...] > + (regexp-opt > + (remove nil > + (append > + (list So it basically just uses `regexp-opt' instead of making the regexp itself "manually"? But the result is significantly slower, and the code doesn't seem to be shorter? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/