From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#12796: Optimize `ido-completing-read' for larger lists with flex matching enabled Date: Mon, 05 Nov 2012 09:37:52 +0400 Message-ID: <509750B0.2030000@yandex.ru> References: <5096040B.50002@yandex.ru> <5096A046.6090908@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352093887 7923 80.91.229.3 (5 Nov 2012 05:38:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 05:38:07 +0000 (UTC) Cc: 12796@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 05 06:38:15 2012 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 1TVFO0-0005Mx-OH for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 06:38:12 +0100 Original-Received: from localhost ([::1]:33946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVFNr-0006Qj-PR for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2012 00:38:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVFNp-0006QZ-9a for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 00:38:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVFNo-0005H0-8a for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 00:38:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVFNn-0005Gw-MB for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 00:38:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TVFQk-0004ll-P4 for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2012 00:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Nov 2012 05:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12796 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12796-submit@debbugs.gnu.org id=B12796.135209406118323 (code B ref 12796); Mon, 05 Nov 2012 05:41:02 +0000 Original-Received: (at 12796) by debbugs.gnu.org; 5 Nov 2012 05:41:01 +0000 Original-Received: from localhost ([127.0.0.1]:49603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVFQi-0004lU-HM for submit@debbugs.gnu.org; Mon, 05 Nov 2012 00:41:00 -0500 Original-Received: from forward1h.mail.yandex.net ([84.201.187.146]:52357) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVFQc-0004lA-M6 for 12796@debbugs.gnu.org; Mon, 05 Nov 2012 00:40:57 -0500 Original-Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward1h.mail.yandex.net (Yandex) with ESMTP id 159DB9E1AA0; Mon, 5 Nov 2012 09:37:49 +0400 (MSK) Original-Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id D29442C006B; Mon, 5 Nov 2012 09:37:48 +0400 (MSK) Original-Received: from 127-240.nwlink.spb.ru (127-240.nwlink.spb.ru [178.252.127.240]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bltuBsgS-bmtiqsfq; Mon, 5 Nov 2012 09:37:48 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1352093868; bh=eD01NLAyEycDPxrK/utr5dFH3cl3UQbbolNTj0eS6uo=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=nRQx67RKoYX6jg6ZDIGQe4/rS8Q965tYKoVLztj02aW74LpXb5qpt+wTehomgCn3I 8kPLXZoc+jKj4PoNhgefJcKScuhEQW5L1bKWGS2V3KdCMPCBS7a9XAI4NPOvCZqA5i ad/I0Ju8slwC5SPpEnUgyMDnVBVKc8eI/niHHHxg= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <5096A046.6090908@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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:66465 Archived-At: On 04.11.2012 21:05, Dmitry Gutov wrote: > On 04.11.2012 17:53, Stefan Monnier wrote: >>> If I decide to type quickly but make a typo in one of the first >>> characters, >>> I often need to wait a few seconds until I can fix the typo or start >>> anew. >> >> `while-no-input' (which AFAICT is used by ido) is supposed to interrupt >> the computation as soon as you type the next input so you don't need >> to wait. >> >> Are you saying that while-no-input doesn't work? > > I only see `while-no-input' used in one place there: in > `ido-make-merged-file-list', and that function is only used in > `find-file' mode. > > So yeah, using it around matching loops in `ido-set-matches-1' might be > another way to optimize, provided the overhead is not too much. Disregard the "overhead" remark, I misread what the macro does: it's not actually a looping construct. To try it, I just wrapped in it the "busy" part of `ido-set-matches-1' - and indeed, no more waiting a several seconds after button mashing. It's a bit buggy so far, but that's to be expected. The caching approach still feels faster in most cases, and is instantaneous in cases when we're editing input and have few or no matches for the current input (if we're backspacing, then only when no matches). It has room for usability improvements, too. I won't insist, though. I kind of decided to disable flex anyway and just use regexp matching sometimes. --Dmitry