From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#18522: 24.4.50; mapcar is very slow Date: Sun, 28 Feb 2016 14:32:46 +1030 Message-ID: <87lh65xz15.fsf@gnus.org> References: <8738bkdjqg.fsf@micropit.roche-blanche.homenet.org> <87k2lyszy2.fsf@roche-blanche.net> <83bn79n66p.fsf@gnu.org> <87vb5hry9y.fsf@roche-blanche.net> <83r3g4lnor.fsf@gnu.org> <87r3g4o4uw.fsf@roche-blanche.net> <83h9h0jwfo.fsf@gnu.org> <87mvqru119.fsf@roche-blanche.net> <8360xfjsyr.fsf@gnu.org> <878u2bs7tl.fsf@roche-blanche.net> <83r3g3iajr.fsf@gnu.org> <87twkypfqx.fsf@roche-blanche.net> <83vb5egg8y.fsf@gnu.org> <87fuwikmzc.fsf@roche-blanche.net> <83io1ege6r.fsf@gnu.org> <87y4a9kh9e.fsf@roche-blanche.net> <87vb5dvf6c.fsf@gnus.org> <8760xdi54j.fsf@roche-blanche.net> <83vb5cg4r6.fsf@gnu.org> <87egc0noyf.fsf@gnus.org> <83r3fzeu27.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456632266 4646 80.91.229.3 (28 Feb 2016 04:04:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2016 04:04:26 +0000 (UTC) Cc: pmlists@free.fr, 18522@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 28 05:04:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZsaZ-00010p-EL for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Feb 2016 05:04:11 +0100 Original-Received: from localhost ([::1]:57355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsaY-0006bG-LR for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Feb 2016 23:04:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsaV-0006at-2m for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 23:04:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZsaR-0006ah-2F for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 23:04:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsaQ-0006ad-V3 for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 23:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZsaQ-0001l4-DV; Sat, 27 Feb 2016 23:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sun, 28 Feb 2016 04:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18522 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 18522-submit@debbugs.gnu.org id=B18522.14566322036703 (code B ref 18522); Sun, 28 Feb 2016 04:04:02 +0000 Original-Received: (at 18522) by debbugs.gnu.org; 28 Feb 2016 04:03:23 +0000 Original-Received: from localhost ([127.0.0.1]:49259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZsZn-0001k3-IK for submit@debbugs.gnu.org; Sat, 27 Feb 2016 23:03:23 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:34644) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZsZl-0001jv-9T for 18522@debbugs.gnu.org; Sat, 27 Feb 2016 23:03:21 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZsZK-0007ie-Pu; Sun, 28 Feb 2016 05:02:56 +0100 In-Reply-To: <83r3fzeu27.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Feb 2016 10:48:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZsZK-0007ie-Pu MailScanner-NULL-Check: 1457236977.50603@sKSplz6hg9F8pOV853yJig X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113998 Archived-At: Eli Zaretskii writes: >> (defsubst parse-time-string-chars (char) >> (save-match-data >> (let (case-fold-search str) >> (cond ((eq char ?+) 1) >> ((eq char ?-) -1) >> ((eq char ?:) ?d) >> ((string-match "[[:upper:]]" (setq str (string char))) ?A) >> ((string-match "[[:lower:]]" str) ?a) >> ((string-match "[[:digit:]]" str) ?0))))) [...] > Yes, weird. And even if someone thought of using > parse-time-string-chars in other places that don't necessarily > downcase the string, I don't understand why we should test a character > by making it a string, then matching against [:upper:]. Maybe I'm > missing something. No, that's also rather puzzling. Looking at the rest of the code, we don't really handle anything other than [a-z] and [0-9] here, so using a regexp instead of a (<= ?0 char ?9) (etc.) also seems odd. And losing those `string-match' calls would also mean we could get rid of the `save-match-data' call. I think I'll put together a test harness for `parse-time' and then clean up this function further. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no