From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: [harder@ifa.au.dk: Speed of all-completions] Date: Fri, 18 Jun 2004 13:45:56 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200406181845.i5IIjuj07569@raven.dms.auburn.edu> References: <200406151542.i5FFgaG25896@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1087584490 5362 80.91.224.253 (18 Jun 2004 18:48:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Jun 2004 18:48:10 +0000 (UTC) Cc: schwab@suse.de, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jun 18 20:48:02 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BbOPC-0002ht-00 for ; Fri, 18 Jun 2004 20:48:02 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BbOPB-0004yn-00 for ; Fri, 18 Jun 2004 20:48:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BbOQG-0003rB-7I for emacs-devel@quimby.gnus.org; Fri, 18 Jun 2004 14:49:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BbOQD-0003qw-ES for emacs-devel@gnu.org; Fri, 18 Jun 2004 14:49:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BbOQA-0003qk-RG for emacs-devel@gnu.org; Fri, 18 Jun 2004 14:49:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BbOQA-0003qh-Mp for emacs-devel@gnu.org; Fri, 18 Jun 2004 14:49:02 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BbOOw-0006kw-0O; Fri, 18 Jun 2004 14:47:46 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i5IIlYuE003302; Fri, 18 Jun 2004 13:47:34 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i5IIjuj07569; Fri, 18 Jun 2004 13:45:56 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: dak@gnu.org In-reply-to: (message from David Kastrup on 15 Jun 2004 17:55:47 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25086 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25086 David Kastrup wrote: > Is one single prolonged binding using specbind expensive or was the > efficiency problem completely caused by the fact that it was used > countless times in a loop? The single prolonged binding is expensive, as in most cases the loop is not entered even once. At least that's what I understood. Does not look like it. I could provide a patch and timings showing that with one single binding around essentially the entire functions and _without_ the `if (CONSP (Vcompletion_regexp_list))', there is a 10-fold improvement (in Jesper's example), if completion-regexp-list is non-nil and a negligible deterioration if it is nil (everything compared with the current CVS code). However, before going into that, something else needs to be looked at. Binding (essentially) around the entire functions means that the binding is also in effect around the call to PREDICATE. Actually, if PREDICATE uses case-fold-search, the binding either _should_ be in effect, or PREDICATE should explicitly bind case-fold-search itself. The _one single_ problem with the one prolonged binding might occur if PREDICATE asks questions to the user in the minibuffer. We have forgotten the user defined value and it can not be restored. But it should be restored, because otherwise the user might be confused. It probably is possible to use all-completions and friends in an unusual way (that is, for purposes other than minibuffer completion), where PREDICATE _could_ ask minibuffer questions. _If so_, then we either have to stick with the present version or apply your patch. Sincerely, Luc.