From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Newsgroups: gmane.emacs.bugs Subject: bug#15295: Date: Tue, 24 Dec 2013 17:08:09 -0300 Message-ID: <87sitij9li.fsf@tata.lan> References: <522A7797.4020903@codefu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1387915743 20535 80.91.229.3 (24 Dec 2013 20:09:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 20:09:03 +0000 (UTC) To: 15295-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 21:09:09 2013 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 1VvYHs-00075F-Ag for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 21:09:08 +0100 Original-Received: from localhost ([::1]:40286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvYHr-0004dg-Mm for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 15:09:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvYHo-0004dE-3k for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 15:09:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvYHn-0008IA-6Q for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 15:09:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvYHn-0008I0-3d for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 15:09:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VvYHm-0003jX-S0 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 15:09:02 -0500 In-Reply-To: <522A7797.4020903@codefu.org> Resent-From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2013 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 15295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 15295@debbugs.gnu.org, fgallina@gnu.org, dale@codefu.org Original-Received: via spool by 15295-done@debbugs.gnu.org id=D15295.138791572214305 (code D ref 15295); Tue, 24 Dec 2013 20:09:01 +0000 Original-Received: (at 15295-done) by debbugs.gnu.org; 24 Dec 2013 20:08:42 +0000 Original-Received: from localhost ([127.0.0.1]:39652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvYHR-0003ie-Ny for submit@debbugs.gnu.org; Tue, 24 Dec 2013 15:08:42 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:37906) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvYHP-0003iS-MQ for 15295-done@debbugs.gnu.org; Tue, 24 Dec 2013 15:08:40 -0500 Original-Received: from [181.164.60.202] (port=50247 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VvYHN-0000eC-Jf for 15295-done@debbugs.gnu.org; Tue, 24 Dec 2013 15:08:38 -0500 User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:82544 Archived-At: Fixed in revno 115736. Thanks Dale for such detailed recipe. This patch banishes initial thoughts of `python-syntax-context' being a bad idea. `python-syntax-context' is nothing than a thin semantic wrapper over `syntax-ppss'. It makes code easier to grasp for newcomers to Elisp and has almost no impact on itself, it's optional argument is a `syntax-ppss' list which can be used instead to lower the amount of calls to it (as it is happening in this new patch I've just committed). The problem here was that `python-nav-beginning-of-statement' was coded awfully (looking for the statement beginning line by line). Now it should be extremely fast compared to that. Using OP's suggested recipe, here are the elp results for when which-func is triggered inside the big tuple: python-info-current-defun 2 0.003719249 0.0018596245 python-nav-beginning-of-defun 2 0.0036946010 0.0018473005 python-nav--beginning-of-defun 2 0.003685751 0.0018428755 python-nav-backward-block 2 0.001836524 0.000918262 python-nav-forward-block 2 0.0018315750 0.0009157875 python-info-looking-at-beginning-of-defun 6 0.000889166 0.0001481943 python-nav-beginning-of-statement 4 0.000437251 0.0001093127 python-syntax-context-type 6 5.009e-06 8.348...e-07 And this is the benchmark-run result: (0.020715153 0 0.0) Regards, Fabián.