From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Inefficient code in xml.el Date: Mon, 06 Jun 2005 13:51:25 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118058574 28564 80.91.229.2 (6 Jun 2005 11:49:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2005 11:49:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 06 13:49:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DfG5U-0004F0-Vm for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2005 13:48:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfGBn-0008L7-Md for ged-emacs-devel@m.gmane.org; Mon, 06 Jun 2005 07:54:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DfGBM-0008HY-4l for emacs-devel@gnu.org; Mon, 06 Jun 2005 07:54:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DfGBG-0008Ei-GJ for emacs-devel@gnu.org; Mon, 06 Jun 2005 07:54:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfGBG-0008EN-Ae for emacs-devel@gnu.org; Mon, 06 Jun 2005 07:54:10 -0400 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DfGBP-0005eq-EN for emacs-devel@gnu.org; Mon, 06 Jun 2005 07:54:19 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepb.post.tele.dk (Postfix) with SMTP id E8AAA5EE046; Mon, 6 Jun 2005 13:51:04 +0200 (CEST) Original-To: Mark A. Hershberger User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38158 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38158 I noticed that xml.el has several occurences of code like this: ((looking-at (concat "")) (let ((name (buffer-substring (nth 2 (match-data)) (nth 3 (match-data)))) (value (buffer-substring (+ (nth 4 (match-data)) 1) (- (nth 5 (match-data)) 1)))) (goto-char (nth 1 (match-data))) Using (match-data) like that is VERY, VERY inefficient. Use either match-beginning/match-end, or match-string instead. -- Kim F. Storm http://www.cua.dk