From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: [elpa] master 9f21e1d 06/18: Add a matching optimization Date: Mon, 20 Apr 2015 17:08:17 +0200 Message-ID: <87oamiet26.fsf@gmail.com> References: <20150420123900.21320.5807@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429542931 14398 80.91.229.3 (20 Apr 2015 15:15:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2015 15:15:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 20 17:15:30 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YkDPl-0004wG-EE for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 17:15:13 +0200 Original-Received: from localhost ([::1]:54102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkDPf-00041M-Kk for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 11:15:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkDOY-0002pk-8H for emacs-devel@gnu.org; Mon, 20 Apr 2015 11:13:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkDOT-0005K8-VO for emacs-devel@gnu.org; Mon, 20 Apr 2015 11:13:58 -0400 Original-Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:34407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkDOT-0005Jw-Om for emacs-devel@gnu.org; Mon, 20 Apr 2015 11:13:53 -0400 Original-Received: by wicmx19 with SMTP id mx19so42461893wic.1 for ; Mon, 20 Apr 2015 08:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=dY+LCnYObQTPjdK0MVcKjEMhEzRP9A0LsQWhXczf6Uw=; b=PP4CD/g21SC5op/S7RVQN+o1lQhfBAeQkzVW9jonWuDlCrXQVQkZ5G1LhDrydb4ghQ gnulGtfQELIDuXRlgerPXQudcXURLu+d32xCHwPo+q5hUghnbM/eNRCF6seTPEx2G9D2 vBWfbGYQ131Eo9pD+tZBm88jpjGTZjcSaeVcpixiE/UW7K3L4ymxgCdWQhrbkneCpFrg INsGj3hXi9ffKa69KpcN38ebZBo3yZyT3F3HVXDQOo44Z0UChm4NEcEIuabTB4vWg1qt 0M6e2LwQs7nGmK2Y0tVCOnS2yhwSix+fdy2FoZptZNE48/P8J5YF0el+bWidEsqGbWig uiAg== X-Received: by 10.194.177.132 with SMTP id cq4mr30560389wjc.99.1429542833142; Mon, 20 Apr 2015 08:13:53 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by mx.google.com with ESMTPSA id v3sm15666330wix.8.2015.04.20.08.13.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 20 Apr 2015 08:13:52 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 20 Apr 2015 11:02:45 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185709 Archived-At: Stefan Monnier writes: >> * ivy.el (ivy-completions): When the new regex `re' is a contains the >> old regex `ivy--old-re', it must be true that all candidates that >> match `re' are contained inside all candidates that match > > IIUC ivy-mode treats the minibuffer's content as a regexp, so the user > can write any fancy regexp she wants. In that case, the above is > actually not guaranteed. E.g. "foo" matches fewer candidates than > "foo?". True, it's an optimization for the most basic use of space separated words. But I was playing around with filtering the 3000000 lines git grep in the emacs repo, and I wanted to see if it would be faster with the optimization. I'll either add a custom var to turn this optimization on/off or try to check if the input is just space-separated words. >> + ((and ivy--old-re (eq 0 (cl-search ivy--old-re re))) > > Why not use string-prefix-p? Because I didn't know about it. I'll switch. Oleh