From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Date: Thu, 12 Sep 2013 22:45:21 -0700 (PDT) Message-ID: <1b2ab855-2c0d-4fdb-963b-6782f91fb2e2@default> References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1379051183 25490 80.91.229.3 (13 Sep 2013 05:46:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Sep 2013 05:46:23 +0000 (UTC) Cc: 15294@debbugs.gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 13 07:46:24 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 1VKMD1-0001TU-AL for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 07:46:23 +0200 Original-Received: from localhost ([::1]:44865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKMD0-0002TX-HW for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Sep 2013 01:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKMCp-0002SY-5a for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 01:46:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKMCg-0005S6-JS for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 01:46:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKMCg-0005S0-Fy for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 01:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VKMCf-000299-TM for bug-gnu-emacs@gnu.org; Fri, 13 Sep 2013 01:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Sep 2013 05:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15294 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15294-submit@debbugs.gnu.org id=B15294.13790511338213 (code B ref 15294); Fri, 13 Sep 2013 05:46:01 +0000 Original-Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 05:45:33 +0000 Original-Received: from localhost ([127.0.0.1]:60499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKMCC-00028O-CB for submit@debbugs.gnu.org; Fri, 13 Sep 2013 01:45:32 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:22776) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKMCA-000287-5C for 15294@debbugs.gnu.org; Fri, 13 Sep 2013 01:45:30 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8D5jN5Q022246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Sep 2013 05:45:23 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8D5jMN6018297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Sep 2013 05:45:23 GMT Original-Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8D5jMGi018290; Fri, 13 Sep 2013 05:45:22 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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:78317 Archived-At: > > Or is the byte compiler likely to be improved in this regard, so users > > need not be aware of it and take measures manually? >=20 > As indicated in the FIXMEs I added in src/bytecode.c at the time, the > current byte codes for unwind-protect, condition-case, and catch are > very inefficient for lexical-binding code. >=20 > I do hope to fix those issues by introducing other byte-codes which will > let us generate significantly more efficient code for those constructs, > but in 24.1, the priority was to get lexical-binding to work correctly, > performance being a secondary concern (tho for most idiomatic Elisp > code, the performance tends to be competitive). >=20 > What people should know is that >=20 > (let (x y z) > ...(setq x ...) > ...(setq z ...) > ...(setq y ...) >=20 > is often a bad idea in Elisp, and even more so in lexical-binding code > (in some cases, if a variable is immutable it can be handled > significantly more efficiently, so the mere existence of a single `setq' > on a variable can sometimes slow other chunks of code: in many cases > `let' is cheaper than `setq'). Thank you for both answers. Will the second apply even after making the byte-compiler improvements described for the first? (I'm guessing yes.) If so, you might want to mention this guideline in the manual.