From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 17:00:11 2013 Received: (at submit) by debbugs.gnu.org; 6 Sep 2013 21:00:11 +0000 Received: from localhost ([127.0.0.1]:45017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI38U-0008QZ-1Y for submit@debbugs.gnu.org; Fri, 06 Sep 2013 17:00:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55794) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI38L-0008PP-Rw for submit@debbugs.gnu.org; Fri, 06 Sep 2013 17:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI38B-0003lF-50 for submit@debbugs.gnu.org; Fri, 06 Sep 2013 16:59:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI38B-0003l6-2X for submit@debbugs.gnu.org; Fri, 06 Sep 2013 16:59:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI386-0001Qh-3o for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 16:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI381-0003kY-28 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 16:59:45 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:62419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI380-0003kR-Pr for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 16:59:40 -0400 Received: by mail-wi0-f178.google.com with SMTP id hn9so1421066wib.17 for ; Fri, 06 Sep 2013 13:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=L4LiglBH1D8ijRAVmDX8nnWWQEQtHvYKJXvGUv/Xu48=; b=OsnmI656klq2/6+CaZgXc2BFW5aVGvaWRpEY1do8jW8MhUVt8LJUljJuiz3la2e675 6tcKXVvx/rivBBnPP+24O2IaPsaIX2mJJ9aCNPzTgnLjLO+8RzW5VRDCeyG99rOcfVUm av5IKXmXzOLH94dYW1JynOFYYx8v99XX/SpnKv4pa5e9jx4QwUzYm6+VsTFKff+IR5b5 i5t2NJyQ9Q6fu69y9agB1lwyJY2gbLZI1hWdY7yl6z9emDR0CmALsVtN1tqw5064V2o2 EVcW5twX5ypdytysS2DLYOwY/s2m5rA6g9qv0OMzENaQTqGuW21QyB1Gd0pG/wjxCUMZ n4Nw== X-Received: by 10.194.78.78 with SMTP id z14mr3716321wjw.32.1378501179705; Fri, 06 Sep 2013 13:59:39 -0700 (PDT) Received: from axl (62-118-214.netrun.cytanet.com.cy. [62.228.118.214]) by mx.google.com with ESMTPSA id z2sm307504wiv.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 13:59:36 -0700 (PDT) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Date: Fri, 06 Sep 2013 23:59:20 +0300 Message-ID: <871u51ll93.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) If I append -*- lexical-binding: t -*- to the first line of js2-mode.el and eval the buffer, parsing a file takes several (3 to 4) times longer. To measure: 0. Install js2-mode, e.g. from GNU ELPA. 1. Save http://mootools.net/download/get/mootools-core-1.4.5-full-nocompat.js to some local directory, open it in Emacs. 2. If it opens in some other mode than js2-mode, M-x js2-mode. 3. Don't touch the keys, wait until the file is parsed (the parsing gets interrupted and rescheduled on input). When redisplay works again, we can re-parse the file again and measure the time it takes. 4. eval-expression (js2-time (js2-reparse t)), wait until the message area displays the amount of seconds the process took. To measure the performance in interpreted mode, open js2-mode.el, M-x eval-buffer and go through the above scenario (1-4). To measure the performance in compiled mode, M-x byte-compile-file, then (load "js2-mode.elc"), then go through the scenario. My measurements: lexical-binding | no | yes | Interpreted | 1 sec | 4.26 sec | Compiled | 0.63 sec | 1.76 sec | -- In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4) of 2013-09-06 on axl Bzr revision: 114159 dmantipov@yandex.ru-20130906164012-6j0s6otwkypj9s1z Windowing system distributor `The X.Org Foundation', version 11.0.11303000 System Description: Ubuntu 13.04 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 19:44:45 2013 Received: (at 15294-done) by debbugs.gnu.org; 6 Sep 2013 23:44:45 +0000 Received: from localhost ([127.0.0.1]:45227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI5hl-00040n-JU for submit@debbugs.gnu.org; Fri, 06 Sep 2013 19:44:45 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:53115) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI5hk-00040a-3W for 15294-done@debbugs.gnu.org; Fri, 06 Sep 2013 19:44:44 -0400 Received: by mail-ie0-f178.google.com with SMTP id f4so8639751iea.9 for <15294-done@debbugs.gnu.org>; Fri, 06 Sep 2013 16:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UfcwnmdGdhupgr8w0ZwTWDofoxRcB0dmHZ5THDFO7QE=; b=0SwRTo+T2cfsho7w7bPn+nZSMJm2aZVha9M8q8dSIuTs04xpNtltMhu40ou0oFvUCA 4f8O3qvedh7qVYIntfIMasyL6Aj2dcB/3CozUBZWc9CEaKQ7XzerI+0Pffa3sFHHJRyF zTG3GRcNscCmj/atUCm3uhRfcRLicPWiJaaAqNhWPjnnKP7MlMftJNc6Yonwe7ZZd1ez lJwazEvccUfuIAxmlCbl9XWhfhm+qeQN1CpXaNwvQHDsQk9xWfELgYKwMCV2jhY0HVTR 0nLs8HW1axthtOzobNGyIa95lpGonhXY5WD/M1geFYmVIaJPMVEfXqK0DXuB9UPzWMXw desQ== MIME-Version: 1.0 X-Received: by 10.50.50.210 with SMTP id e18mr297959igo.9.1378511078476; Fri, 06 Sep 2013 16:44:38 -0700 (PDT) Received: by 10.42.51.75 with HTTP; Fri, 6 Sep 2013 16:44:38 -0700 (PDT) Date: Sat, 7 Sep 2013 07:44:38 +0800 Message-ID: Subject: Re: 24.3.50; js2-mode parser is several times slower in lexical-binding mode From: Xue Fuqiao To: 15294-done@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Fixed in revision 114156. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 23:15:42 2013 Received: (at 15294) by debbugs.gnu.org; 7 Sep 2013 03:15:42 +0000 Received: from localhost ([127.0.0.1]:45486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI8zt-0001q9-IY for submit@debbugs.gnu.org; Fri, 06 Sep 2013 23:15:41 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:54354) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VI8zp-0001pW-O1; Fri, 06 Sep 2013 23:15:38 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="26740527" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 06 Sep 2013 23:12:12 -0400 Received: by pastel.home (Postfix, from userid 20848) id D373562CC9; Fri, 6 Sep 2013 23:15:15 -0400 (EDT) From: Stefan Monnier To: 15294@debbugs.gnu.org Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> Date: Fri, 06 Sep 2013 23:15:15 -0400 In-Reply-To: (Xue Fuqiao's message of "Sat, 7 Sep 2013 07:44:38 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: xfq.free@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) reopen 15294 thanks > Fixed in revision 114156. No, 114156 fixes another problem (which affected both lexical and dynamic binding code). Stefan From unknown Sat Sep 06 14:23:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Sat, 07 Sep 2013 03:16:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 18:32:10 2013 Received: (at 15294) by debbugs.gnu.org; 8 Sep 2013 22:32:10 +0000 Received: from localhost ([127.0.0.1]:49446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VInWc-0003LM-Bv for submit@debbugs.gnu.org; Sun, 08 Sep 2013 18:32:10 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:33170) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VInWa-0003L2-SK for 15294@debbugs.gnu.org; Sun, 08 Sep 2013 18:32:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="26854894" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Sep 2013 18:28:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id 8FCE962E36; Sun, 8 Sep 2013 18:32:02 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> Date: Sun, 08 Sep 2013 18:32:02 -0400 In-Reply-To: <871u51ll93.fsf@yandex.ru> (Dmitry Gutov's message of "Fri, 06 Sep 2013 23:59:20 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) A first likely candidate is the bunch of `catch/throw' in js2-get-token, since catch, unwind-protect and condition-case are all implemented in the bytecode interpreter in ways which don't work well for lexical scoping. Stefan "Just reporting on his little progress" From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 09 22:04:58 2013 Received: (at 15294) by debbugs.gnu.org; 10 Sep 2013 02:04:58 +0000 Received: from localhost ([127.0.0.1]:51172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJDK5-0007dl-7i for submit@debbugs.gnu.org; Mon, 09 Sep 2013 22:04:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:31363) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJDK2-0007dW-U7 for 15294@debbugs.gnu.org; Mon, 09 Sep 2013 22:04:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2OLoJcA6R6gV6Caik X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2OLoJcA6R6gV6Caik X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27059366" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 09 Sep 2013 22:01:25 -0400 Received: by pastel.home (Postfix, from userid 20848) id BEC5D63031; Mon, 9 Sep 2013 22:04:38 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> Date: Mon, 09 Sep 2013 22:04:38 -0400 In-Reply-To: <871u51ll93.fsf@yandex.ru> (Dmitry Gutov's message of "Fri, 06 Sep 2013 23:59:20 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > If I append -*- lexical-binding: t -*- to the first line of js2-mode.el > and eval the buffer, parsing a file takes several (3 to 4) times longer. [ I'm disregarding the interpreted time for now, since the issues are likely to be different. ] In the compiled case, loading js2-mode-lexical.elc and then redefining `js2-get-token' to the value it has in js2-mode-dynamic.elc brings me back the same speed as with js2-mode-dynamic.elc. IOW the slowdown is in js2-get-token. If it indeed comes from the handling of catch/throw, then there are two ways to fix it: - provide a new byte-code for catch which does not require wrapping the body in a closure. This should not be terribly difficult and would benefit all existing code, but it does require changes to the way catch is implemented. - improve the byte-compiler so it can compile away cl-block/cl-return. This should not require new byte-codes, but requires delving "deepish" into the byte-compiler. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 12 23:40:53 2013 Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 03:40:54 +0000 Received: from localhost ([127.0.0.1]:60345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKKFZ-0006FA-K3 for submit@debbugs.gnu.org; Thu, 12 Sep 2013 23:40:53 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:38898) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKKFX-0006Ev-Ey for 15294@debbugs.gnu.org; Thu, 12 Sep 2013 23:40:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27588612" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Sep 2013 23:37:14 -0400 Received: by pastel.home (Postfix, from userid 20848) id 67F6E62E78; Thu, 12 Sep 2013 23:40:45 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> Date: Thu, 12 Sep 2013 23:40:45 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 09 Sep 2013 22:04:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > In the compiled case, loading js2-mode-lexical.elc and then redefining > `js2-get-token' to the value it has in js2-mode-dynamic.elc brings me > back the same speed as with js2-mode-dynamic.elc. > IOW the slowdown is in js2-get-token. It seems the slowdown is indeed linked to the way `catch' is handled (indeed, this non-idiomatic ELisp code ends up byte-compiled in a really poor way). The trivial patch below brings the time down from 5s to 2.6s (as compared to 2.1s for the dynamic-binding version). Stefan diff --git a/packages/js2-mode/js2-mode.el b/packages/js2-mode/js2-mode.el index 3568f18..1d76469 100644 --- a/packages/js2-mode/js2-mode.el +++ b/packages/js2-mode/js2-mode.el @@ -5310,10 +5311,10 @@ corresponding number. Otherwise return -1." (defun js2-get-token () "Return next JavaScript token, an int such as js2-RETURN." - (let (c c1 identifier-start is-unicode-escape-start - contains-escape escape-val str result base - is-integer quote-char val look-for-slash continue) - (catch 'return + (catch 'return + (let (c c1 identifier-start is-unicode-escape-start + contains-escape escape-val str result base + is-integer quote-char val look-for-slash continue) (while t ;; Eat whitespace, possibly sensitive to newlines. (setq continue t) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 00:00:10 2013 Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 04:00:10 +0000 Received: from localhost ([127.0.0.1]:60387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKKYC-0006nO-HM for submit@debbugs.gnu.org; Fri, 13 Sep 2013 00:00:09 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32351) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKKY5-0006jL-Ik for 15294@debbugs.gnu.org; Fri, 13 Sep 2013 00:00:03 -0400 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 r8D3xsTQ016876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Sep 2013 03:59:55 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8D3xrb1009229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Sep 2013 03:59:53 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8D3xqK0010499; Fri, 13 Sep 2013 03:59:52 GMT MIME-Version: 1.0 Message-ID: <0b29ebee-8ed4-47e2-816b-910a013a0898@default> Date: Thu, 12 Sep 2013 20:59:52 -0700 (PDT) From: Drew Adams To: Stefan Monnier , Dmitry Gutov Subject: RE: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) > It seems the slowdown is indeed linked to the way `catch' is handled > (indeed, this non-idiomatic ELisp code ends up byte-compiled in a really > poor way). The trivial patch below brings the time down from 5s to 2.6s > (as compared to 2.1s for the dynamic-binding version). > > - (let (c c1 identifier-start is-unicode-escape-start > - contains-escape escape-val str result base > - is-integer quote-char val look-for-slash continue) > - (catch 'return > + (catch 'return > + (let (c c1 identifier-start is-unicode-escape-start > + contains-escape escape-val str result base > + is-integer quote-char val look-for-slash continue) Not really following this thread, but this caught my eye. Is this something that should be mentioned as a guideline in the manual? Or is the byte compiler likely to be improved in this regard, so users need not be aware of it and take measures manually? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 00:37:36 2013 Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 04:37:37 +0000 Received: from localhost ([127.0.0.1]:60425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKL8R-0000IZ-K2 for submit@debbugs.gnu.org; Fri, 13 Sep 2013 00:37:36 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:50031) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKL8O-0000IH-8R for 15294@debbugs.gnu.org; Fri, 13 Sep 2013 00:37:32 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27591528" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Sep 2013 00:33:54 -0400 Received: by pastel.home (Postfix, from userid 20848) id A779662E78; Fri, 13 Sep 2013 00:37:25 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> Date: Fri, 13 Sep 2013 00:37:25 -0400 In-Reply-To: <0b29ebee-8ed4-47e2-816b-910a013a0898@default> (Drew Adams's message of "Thu, 12 Sep 2013 20:59:52 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Or is the byte compiler likely to be improved in this regard, so users > need not be aware of it and take measures manually? 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. 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). What people should know is that (let (x y z) ...(setq x ...) ...(setq z ...) ...(setq y ...) 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'). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 01:45:33 2013 Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 05:45:33 +0000 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 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 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 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 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 MIME-Version: 1.0 Message-ID: <1b2ab855-2c0d-4fdb-963b-6782f91fb2e2@default> Date: Thu, 12 Sep 2013 22:45:21 -0700 (PDT) From: Drew Adams To: Stefan Monnier Subject: RE: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) > > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 09:01:13 2013 Received: (at 15294) by debbugs.gnu.org; 13 Sep 2013 13:01:13 +0000 Received: from localhost ([127.0.0.1]:32950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKSzo-0006uw-KH for submit@debbugs.gnu.org; Fri, 13 Sep 2013 09:01:13 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:28917) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKSzl-0006ug-PS for 15294@debbugs.gnu.org; Fri, 13 Sep 2013 09:01:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27620347" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Sep 2013 08:57:31 -0400 Received: by pastel.home (Postfix, from userid 20848) id 2F61962E33; Fri, 13 Sep 2013 09:01:03 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> <1b2ab855-2c0d-4fdb-963b-6782f91fb2e2@default> Date: Fri, 13 Sep 2013 09:01:03 -0400 In-Reply-To: <1b2ab855-2c0d-4fdb-963b-6782f91fb2e2@default> (Drew Adams's message of "Thu, 12 Sep 2013 22:45:21 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> What people should know is that >> >> (let (x y z) >> ...(setq x ...) >> ...(setq z ...) >> ...(setq y ...) >> >> 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. Yes. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 00:20:48 2013 Received: (at 15294) by debbugs.gnu.org; 14 Sep 2013 04:20:48 +0000 Received: from localhost ([127.0.0.1]:35349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKhLj-0006p9-U1 for submit@debbugs.gnu.org; Sat, 14 Sep 2013 00:20:48 -0400 Received: from mail-ea0-f172.google.com ([209.85.215.172]:62201) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKhLb-0006om-C0 for 15294@debbugs.gnu.org; Sat, 14 Sep 2013 00:20:40 -0400 Received: by mail-ea0-f172.google.com with SMTP id r16so938061ead.17 for <15294@debbugs.gnu.org>; Fri, 13 Sep 2013 21:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=fYjrtWR9pV82y++vSF+jIVUgL1OujK0Bo24pi1R6v8Q=; b=W6avwKVIu7YJi+kX/5eADJipL7Qxijyv7B06AJYSL7vkvFnvdKrfvZ0ZaI9Y/Nx2yW 5QH4zGtyLEEFugcsqjW9GPA5tG5keWP0WCd5y4nU6FgKmdwxG0gGZEm7LsJB2Dx06qpO fGlnkh9zwSp3D+gwdtfGEAgBaZaMx3j6ksa+iRupeZEeT3DstEN+FygLR7bBAWvtZbBN zOgoHk5R/kqwoVmzNFqD4RkoUNw/vdM4FMDH+fy7OZOCbIwpf3k1VpnT3dwKMB3d8imW V3ydpyuBBVunS3N25Gke+yK0MuHdzHnnxke850HLQO6MammyHrcS9nFK+Nem23ZZ4nCJ EUGg== X-Received: by 10.15.94.201 with SMTP id bb49mr23487435eeb.23.1379132432870; Fri, 13 Sep 2013 21:20:32 -0700 (PDT) Received: from [192.168.10.2] (62-118-214.netrun.cytanet.com.cy. [62.228.118.214]) by mx.google.com with ESMTPSA id bn13sm20512336eeb.11.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 21:20:32 -0700 (PDT) Message-ID: <5233E40D.4000102@yandex.ru> Date: Sat, 14 Sep 2013 07:20:29 +0300 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 13.09.2013 06:40, Stefan Monnier wrote: > It seems the slowdown is indeed linked to the way `catch' is handled > (indeed, this non-idiomatic ELisp code ends up byte-compiled in a really > poor way). What's non-idiomatic about this use of `catch'? > The trivial patch below brings the time down from 5s to 2.6s (as > compared to 2.1s for the dynamic-binding version). Indeed, it does, in the compiled mode (but please don't install it yet, because it'll complicate merging the `arrow-functions' branch(*)). It does not make much of a difference in the interpreted mode. Now that we have eager macro-expansion, I was rather happy that interpreted js2-mode performance is only like 2x worse than when compiled. But 2.6 vs 2.1, it still a noticeable regression. Do you suppose the usage of `setq' is the main contributor? Speaking of byte-code changes, that seems like a fine idea, but ideally the code should work similarly well on Emacs 24.1-24.3. Or we can just hold off on making js2-mode switch to lexical-binding until [long] after 24.4 is out. (*) Would you take a look at it, too? It has quite a few changes in `js2-get-token' and related functions. They also make performing the same change as in your patch more difficult, since I'm actually using the value returned by `catch' before returning from the function. On 13.09.2013 07:37, Stefan Monnier wrote: > 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'). I see. Does this also extend to `setf' and its defstruct-related functionality? It's all over the js2-mode codebase. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:27:28 2013 Received: (at 15294) by debbugs.gnu.org; 14 Sep 2013 14:27:28 +0000 Received: from localhost ([127.0.0.1]:36687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKqop-0006cM-BL for submit@debbugs.gnu.org; Sat, 14 Sep 2013 10:27:28 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:43740) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKqol-0006c5-RB for 15294@debbugs.gnu.org; Sat, 14 Sep 2013 10:27:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBVg8UBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBVg8UBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27771312" Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Sep 2013 10:23:41 -0400 Received: by pastel.home (Postfix, from userid 20848) id 76ACC62D1E; Sat, 14 Sep 2013 10:27:17 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <5233E40D.4000102@yandex.ru> Date: Sat, 14 Sep 2013 10:27:17 -0400 In-Reply-To: <5233E40D.4000102@yandex.ru> (Dmitry Gutov's message of "Sat, 14 Sep 2013 07:20:29 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> It seems the slowdown is indeed linked to the way `catch' is handled >> (indeed, this non-idiomatic ELisp code ends up byte-compiled in a really >> poor way). > What's non-idiomatic about this use of `catch'? The non-idiomatic part is the "one big let on top, with lots of setq inside". It's clearly C code in Elisp syntax. > It does not make much of a difference in the interpreted mode. The interpreted performance is affected by completely different factors. My guess for the interpreted case is that there are simply "too many" local variables: the environment is represented by a simple alist, so variable lookup time is proportional to the number of local variables. That fine when there are 5 local variables, but is inefficient when you have 100 (better would be a balanced tree or maybe a hash table). This said, I'm not terribly concerned about it: if you need it to go fast, you should byte-compile the code. And I hope we will be able to get rid of the interpreter in some distantish future. > Now that we have eager macro-expansion, I was rather happy that interpreted > js2-mode performance is only like 2x worse than when compiled. Eager macro-expansion indeed speeds up interpreted code, even though the intention was rather to get one-step closer to the elimination of interpretation. > But 2.6 vs 2.1, it still a noticeable regression. Do you suppose the usage > of `setq' is the main contributor? The problem goes as follows: 1- Because of how the `catch' byte-code works, for a (catch TAG BODY) where BODY refers to some surrounding lexical variables LVARS, the byte-compiler needs to turn the code into something similar to: (let ((body-fun (make-closure LVARS () BODY))) (catch TAG (funcall body-fun))) 2- When a lexical variable is both a- caught in a closure b- not immutable the byte-compiler can't store this variable in the bytecode stack (since the closure can't refer to the bytecode stack directly, but instead stores *copies* of the elements it needs), so it needs to change code like (let ((lvar VAL1)) ... (setq lvar VAL2) ...(lambda () ..lvar..)...) into (let ((lvar (list VAL1))) ... (setcar lvar VAL2) ...(lambda () ..(car lvar)..)...) So if you look at js2-get-token, you'll see that the code does not directly use any closure, but the use of `catch' ends up putting most of the body into various closures. And since all variables are declared outside of the catch but used inside, and they're all modified by `setq', they all end up converted as above, so that every use of such a variable turns into "get the cons cell from the environment, then apply car to it". By moving the let inside the catch, some of those variables end up not being caught by a closure any more, so they don't need to be converted to cons cells, hence the reduction from 5s down to 2.6s. > (*) Would you take a look at it, too? It has quite a few changes in > js2-get-token' and related functions. > They also make performing the same change as in your patch more > difficult, since I'm actually using the value returned by `catch' > before returning from the function. That's not a problem. The rule to follow is simply: sink the `let' bindings closer to their use. You don't need to `let' bind all those vars together in one big `let': you can split this let into various `let's which you can then move deeper into the code. In some cases you'll find that some of those vars don't even need to be `setq'd any more. Note that such a "scope-reduction" can also be done in C and in many cases it's also a good idea to do it in C, tho the impact on performance is much less significant because C doesn't have closures. >> 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'). > I see. Does this also extend to `setf' and its defstruct-related > functionality? It has to do specifically with `setq' (i.e. modification of plain variables): when `setf' expands to `setq', `setf' is impacted, otherwise no. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 20:11:55 2013 Received: (at 15294) by debbugs.gnu.org; 15 Sep 2013 00:11:55 +0000 Received: from localhost ([127.0.0.1]:37396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKzwR-0004RT-0X for submit@debbugs.gnu.org; Sat, 14 Sep 2013 20:11:55 -0400 Received: from mail-ea0-f176.google.com ([209.85.215.176]:64960) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VKzwN-0004R8-UW for 15294@debbugs.gnu.org; Sat, 14 Sep 2013 20:11:52 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so1294961ead.35 for <15294@debbugs.gnu.org>; Sat, 14 Sep 2013 17:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1+gYmxHgCYVVH/e/X1o+jIXWNBye5/J99NqqfgruBjQ=; b=BCQtr4rl/6SEmOJzz8hMSm4ZwULwhyH4nMpoc8OZg04FlCCbZnShE/Wqvqat1bnVL/ Erc6uuRWV4SrIUM5qhwEABk4uSgaLsDomWtuRvOjf9Qj9F3zUIQ0ImKqWq07AxIASwJh KXCKTmW++CiqN7+dPK8hoh28W/wcZBrvf4IQke/vL8fcm8r2FD37B0FQJWkHZpsxzNZh +b3r1SOchI7vZoydVi7JzufJo0XTTLKp/Xd16xzghLN+U0ifqzkALKmV2NaZ4odkLwbL vlsrn24n9HvOKE9ZF8elF9ykKMgDoRNKuOP3gl3s1Dp1z2LNGuFQWRz001YHJMofK93v JzeQ== X-Received: by 10.14.241.74 with SMTP id f50mr30520700eer.29.1379203905962; Sat, 14 Sep 2013 17:11:45 -0700 (PDT) Received: from [192.168.10.2] (62-118-214.netrun.cytanet.com.cy. [62.228.118.214]) by mx.google.com with ESMTPSA id j7sm28180708eeo.15.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 17:11:45 -0700 (PDT) Message-ID: <5234FB3D.40209@yandex.ru> Date: Sun, 15 Sep 2013 03:11:41 +0300 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <5233E40D.4000102@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 14.09.2013 17:27, Stefan Monnier wrote: >>> It seems the slowdown is indeed linked to the way `catch' is handled >>> (indeed, this non-idiomatic ELisp code ends up byte-compiled in a really >>> poor way). >> What's non-idiomatic about this use of `catch'? > > The non-idiomatic part is the "one big let on top, with lots of setq > inside". It's clearly C code in Elisp syntax. Or rather Java code, considering its origins. In general, we have to stay close enough to the SpiderMonkey codebase to be able to port new syntax features easily. You've explained how this is bad when combined with closures, but other than gotchas with `catch' (and `condition-case', I'm assuming), we don't have any higher-order functions in the parser. No lambda forms anywhere, at least. Can the fact that `dotimes', `dolist' and `loop' are advised with `cl--wrap-in-nil-block', which expands into `catch' form, make much of a difference? >> It does not make much of a difference in the interpreted mode. > > The interpreted performance is affected by completely different factors. > My guess for the interpreted case is that there are simply "too many" > local variables: the environment is represented by a simple alist, so > variable lookup time is proportional to the number of local variables. > That fine when there are 5 local variables, but is inefficient when you > have 100 (better would be a balanced tree or maybe a hash table). `js2-get-token' has 13 local variables (*). Which is, while not a little, far from 100. Most of the other functions have fewer than that. Are you counting the global variables, too? The dynamic-binding interpreter has to work with them, too. How is it that much faster? (*) According to Steve's notes, symbol lookup in alists is faster than in Emacs hashtables until 50+ elements. Or was, around the year 2009. > This said, I'm not terribly concerned about it: if you need it to go > fast, you should byte-compile the code. I guess so. The sloppy users who disregarded the instructions to byte-compile the code were actually creating a bad reputation for js2-mode 1-2 years ago, but since package.el is much more popular now, it should be less of a problem. >> But 2.6 vs 2.1, it still a noticeable regression. Do you suppose the usage >> of `setq' is the main contributor? > > The problem goes as follows: ... Thank you for the detailed explanation. There are a few `catch' forms left there, for tags `continue' and `break', used for control flow. So, most of the 0.5s difference left is likely due to them, right? I wonder how hard it'll be to rewrite that without `catch'. >> (*) Would you take a look at it, too? It has quite a few changes in >> js2-get-token' and related functions. > >> They also make performing the same change as in your patch more >> difficult, since I'm actually using the value returned by `catch' >> before returning from the function. > > That's not a problem. The rule to follow is simply: sink the `let' > bindings closer to their use. You don't need to `let' bind all those > vars together in one big `let': you can split this let into various > `let's which you can then move deeper into the code. In some cases > you'll find that some of those vars don't even need to be `setq'd any > more. Thanks, will do. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 20:24:24 2013 Received: (at 15294) by debbugs.gnu.org; 15 Sep 2013 00:24:24 +0000 Received: from localhost ([127.0.0.1]:37417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL08V-0005nI-Lw for submit@debbugs.gnu.org; Sat, 14 Sep 2013 20:24:24 -0400 Received: from mail-ea0-f176.google.com ([209.85.215.176]:46456) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL08R-0005mx-LO for 15294@debbugs.gnu.org; Sat, 14 Sep 2013 20:24:20 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so1279799ead.7 for <15294@debbugs.gnu.org>; Sat, 14 Sep 2013 17:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=uqN2OVC2cNnKcQUVJm07pe6cTaKCUEXGlCNSPgqJxfE=; b=S88WB+tWkoI8tX+7QAFlffmSulYf3iSyf7Ipjv1sQx+VeItnx5a8UFMFtgEp5/m3HE USFrQKIB39y0GC9RQgi/qbJHpljdARQ/RNvvSyWzlX5yZMxeChhL8a3DjwxWxVXEOC39 A68yMG50YuvHyFQ3cOCFxFM7xN1JJh1T5x159oAax2oeGsy6mAUZYfUPiswMnUHVcWTT 5Iwj471gEGDJUIlhvI0p9nkOtXUC9VjzcPrl40z4G8WsLB+dTUn7Cj5FCMH56uMU7I1R giyrxcrwYp1FqLJiL395opaQ3ZGO29o9MYMXHOCt/v8cTAgOs06Fjk8D6Kugk2It5Vgs 4Grw== X-Received: by 10.15.64.1 with SMTP id n1mr30679771eex.15.1379204653847; Sat, 14 Sep 2013 17:24:13 -0700 (PDT) Received: from [192.168.10.2] (62-118-214.netrun.cytanet.com.cy. [62.228.118.214]) by mx.google.com with ESMTPSA id y47sm28261447eew.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 17:24:13 -0700 (PDT) Message-ID: <5234FE2A.10105@yandex.ru> Date: Sun, 15 Sep 2013 03:24:10 +0300 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 10.09.2013 05:04, Stefan Monnier wrote: > If it indeed comes from the handling of catch/throw, then there are two > ways to fix it: > - ... > - improve the byte-compiler so it can compile away cl-block/cl-return. > This should not require new byte-codes, but requires delving "deepish" > into the byte-compiler. This would take care of `cl-block' wrappers, but it would do nothing about explicit uses of `catch', right? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 01:04:24 2013 Received: (at 15294) by debbugs.gnu.org; 15 Sep 2013 05:04:24 +0000 Received: from localhost ([127.0.0.1]:37723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL4VT-0004G9-If for submit@debbugs.gnu.org; Sun, 15 Sep 2013 01:04:23 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:42120) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL4VR-0004Ft-9t for 15294@debbugs.gnu.org; Sun, 15 Sep 2013 01:04:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27848534" Received: from 184-175-16-104.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Sep 2013 01:00:36 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id AE5BFAE29B; Sun, 15 Sep 2013 01:04:22 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <5233E40D.4000102@yandex.ru> <5234FB3D.40209@yandex.ru> Date: Sun, 15 Sep 2013 01:04:22 -0400 In-Reply-To: <5234FB3D.40209@yandex.ru> (Dmitry Gutov's message of "Sun, 15 Sep 2013 03:11:41 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Can the fact that `dotimes', `dolist' and `loop' are advised with > cl--wrap-in-nil-block', which expands into `catch' form, make much > of a difference? No, these only expand to `catch' if there's a `return' inside. > `js2-get-token' has 13 local variables (*). Which is, while not a little, > far from 100. Most of the other functions have fewer than that. I don't know how many it takes to be significantly slower than `symbol-value'. > Are you counting the global variables, too? No. But arguments, yes, and every (defvar ) between point and BOB as well. > The dynamic-binding interpreter has to work with them, too. How is it > that much faster? Dynamic binding lookup is done by `symbol-value' which is just a field access (plus checking that the var is not special (e.g. buffer-local or a predefined C variable). >>> But 2.6 vs 2.1, it still a noticeable regression. Do you suppose the usage >>> of `setq' is the main contributor? >> The problem goes as follows: ... > Thank you for the detailed explanation. > There are a few `catch' forms left there, for tags `continue' and `break', > used for control flow. So, most of the 0.5s difference left is likely due to > them, right? The problem is not just the use of catch, but the combination of "catch" with all those vars let-bound outside of catch, used inside, and mutated: - make a variable immutable (i.e. remove the setqs on it) and that variable becomes more efficient again. - move the let binding inside the catch, and the var becomes efficient again. - don't use the variable inside the catch, and it becomes efficient again. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 01:06:08 2013 Received: (at 15294) by debbugs.gnu.org; 15 Sep 2013 05:06:08 +0000 Received: from localhost ([127.0.0.1]:37730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL4XA-0004Iw-Dn for submit@debbugs.gnu.org; Sun, 15 Sep 2013 01:06:08 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:31607) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VL4X8-0004IV-Qr for 15294@debbugs.gnu.org; Sun, 15 Sep 2013 01:06:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMQCw4mEhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFG4rxBo/2dsb2JhbABEuzWDWRdzgh4BAQQBViMQCw4mEhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27848789" Received: from 184-175-16-104.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Sep 2013 01:02:22 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 7FF91AE29B; Sun, 15 Sep 2013 01:06:08 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <5234FE2A.10105@yandex.ru> Date: Sun, 15 Sep 2013 01:06:08 -0400 In-Reply-To: <5234FE2A.10105@yandex.ru> (Dmitry Gutov's message of "Sun, 15 Sep 2013 03:24:10 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> If it indeed comes from the handling of catch/throw, then there are two >> ways to fix it: >> - ... >> - improve the byte-compiler so it can compile away cl-block/cl-return. >> This should not require new byte-codes, but requires delving "deepish" >> into the byte-compiler. > This would take care of `cl-block' wrappers, but it would do nothing about > explicit uses of `catch', right? All js2-mode's uses of catch/throw can be replaced with block/return, AFAICT (not that it's useful right now, since they'll just be macroexpanded back to catch/throw). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 12:54:30 2013 Received: (at 15294) by debbugs.gnu.org; 15 Sep 2013 16:54:30 +0000 Received: from localhost ([127.0.0.1]:38856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VLFaf-00066f-Bd for submit@debbugs.gnu.org; Sun, 15 Sep 2013 12:54:29 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:60517 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VLFad-00066S-Ex for 15294@debbugs.gnu.org; Sun, 15 Sep 2013 12:54:28 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VLFac-0001a9-De; Sun, 15 Sep 2013 12:54:26 -0400 Date: Sun, 15 Sep 2013 12:54:26 -0400 Message-Id: Content-Type: text/plain; charset=ISO-8859-15 From: Richard Stallman To: Dmitry Gutov In-reply-to: <5234FB3D.40209@yandex.ru> (message from Dmitry Gutov on Sun, 15 Sep 2013 03:11:41 +0300) Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <5233E40D.4000102@yandex.ru> <5234FB3D.40209@yandex.ru> X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: rms@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) [ To any NSA and FBI agents reading my email: please consider [ whether defending the US Constitution against all enemies, [ foreign or domestic, requires you to follow Snowden's example. Perhaps we should optimize the implementation of catch in bytecode with some new opcodes. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! That's nonfree (freedom-denying) software. Use Ekiga or an ordinary phone call. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 00:11:29 2013 Received: (at 15294) by debbugs.gnu.org; 19 Sep 2013 04:11:29 +0000 Received: from localhost ([127.0.0.1]:47999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMVaT-00025f-3d for submit@debbugs.gnu.org; Thu, 19 Sep 2013 00:11:29 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:34995) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMVaS-00025X-1J for 15294@debbugs.gnu.org; Thu, 19 Sep 2013 00:11:28 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r8J4BPBU001244; Thu, 19 Sep 2013 00:11:25 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E237466168; Wed, 18 Sep 2013 19:48:48 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> Date: Wed, 18 Sep 2013 19:48:48 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 09 Sep 2013 22:04:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4705=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4705> : inlines <94> : streams <1040348> : uri <1541021> X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) I now have a tentative patch which introduces new bytecodes for "catch" which avoid the need to create closures for lexical-binding code. Current results: - dynbind old-bytecode: 0.84s - dynbind new-bytecode: 0.83s - lexbind old-bytecode: 2.14s - lexbind new-bytecode: 0.67s Of course, code compiled with the new bytecodes won't run on non-bleeding edge Emacs. On my "standard test" (i.e. time to recompile all the emacs/lisp files), the new bytecodes make no measurable difference, so `catch' doesn't seem to be used very much there. Similar changes would be welcome for condition-case and unwind-protect, and since adding new bytecodes is something I'd rather not do too often (and since there aren't many unused bytecodes left), I'll try to get a complete patch first to make sure I don't have to change my mind and use different byte codes. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 22 00:56:53 2013 Received: (at 15294) by debbugs.gnu.org; 22 Sep 2013 04:56:53 +0000 Received: from localhost ([127.0.0.1]:54776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNbj2-0005XU-Qo for submit@debbugs.gnu.org; Sun, 22 Sep 2013 00:56:53 -0400 Received: from mail-ea0-f170.google.com ([209.85.215.170]:54259) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNbj0-0005XH-T6 for 15294@debbugs.gnu.org; Sun, 22 Sep 2013 00:56:51 -0400 Received: by mail-ea0-f170.google.com with SMTP id h14so1026212eak.15 for <15294@debbugs.gnu.org>; Sat, 21 Sep 2013 21:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=sBc9oCbGCGImQQflx254Lwt/Q//5CdAUObmivJQSp/s=; b=yjpCUYaaojIsPYrWA7Z4sBOvicZ6v/0ilM5fkgXJLAVRGrYQmpKjLVDnmAZC/F2Jyr rc/t7ULz2Yoi4ZvRO99WDZWCSO7odSUHBdIrXx6od5ca6UhyHrIyhHvo7LNo8U8UkCjD 21HZbI+xLIYQEscNzYTh7i1BRsWfY4e6/sfK+8tbu/zYMg6ga0HmZQdOtPptYEIy2Wws nt7ouImFCKCz0Z3hPcrkxgaEAJtIdtpUooi4PuWVf6a5UEgSgTz+uePkzLU7EMKN3WuO T9ZccnGbCgU9IW7kk8HdO6Di5nIzgibgfQpipvrNhqJJfqMQX81+Y9Bkiag6imNUCWos w5QQ== X-Received: by 10.15.22.67 with SMTP id e43mr349445eeu.47.1379825804809; Sat, 21 Sep 2013 21:56:44 -0700 (PDT) Received: from axl (62-118-214.netrun.cytanet.com.cy. [62.228.118.214]) by mx.google.com with ESMTPSA id j7sm31515875eeo.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 21 Sep 2013 21:56:44 -0700 (PDT) From: Dmitry Gutov To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> Date: Sun, 22 Sep 2013 07:56:34 +0300 In-Reply-To: (Stefan Monnier's message of "Wed, 18 Sep 2013 19:48:48 -0400") Message-ID: <87y56p78u5.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: > I now have a tentative patch which introduces new bytecodes for > "catch" which avoid the need to create closures for > lexical-binding code. > > Current results: > - dynbind old-bytecode: 0.84s > - dynbind new-bytecode: 0.83s > - lexbind old-bytecode: 2.14s > - lexbind new-bytecode: 0.67s Looks impressive! > Of course, code compiled with the new bytecodes won't run on > non-bleeding edge Emacs. Sure. > Similar changes would be welcome for condition-case and > unwind-protect, and since adding new bytecodes is something I'd rather > not do too often (and since there aren't many unused bytecodes left), > I'll try to get a complete patch first to make sure I don't have to > change my mind and use different byte codes. There's absolutely no hurry, I'm not going to switch js2-mode to lexical-binding until after 24.4 is out. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 01:00:42 2013 Received: (at 15294) by debbugs.gnu.org; 3 Oct 2013 05:00:43 +0000 Received: from localhost ([127.0.0.1]:50962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VRb1m-0000ZY-MM for submit@debbugs.gnu.org; Thu, 03 Oct 2013 01:00:42 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:31341) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VRb1h-0000ZO-Gh for 15294@debbugs.gnu.org; Thu, 03 Oct 2013 01:00:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFsoXM//2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFsoXM//2dsb2JhbABEuzWDWRdzgh8BBVYjEAsOJhIUGA0kiCTBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34647480" Received: from 108-161-115-63.dsl.teksavvy.com (HELO pastel.home) ([108.161.115.63]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Oct 2013 00:57:14 -0400 Received: by pastel.home (Postfix, from userid 20848) id E51F66E028; Thu, 3 Oct 2013 01:00:34 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> Date: Thu, 03 Oct 2013 01:00:34 -0400 In-Reply-To: <87y56p78u5.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 22 Sep 2013 07:56:34 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) You can try setting byte-compile--use-old-handlers to nil now to see if it fixes your performance problems. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 22:38:27 2013 Received: (at 15294) by debbugs.gnu.org; 4 Oct 2013 02:38:27 +0000 Received: from localhost ([127.0.0.1]:52828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VRvHf-0007ys-8o for submit@debbugs.gnu.org; Thu, 03 Oct 2013 22:38:27 -0400 Received: from mail-ee0-f44.google.com ([74.125.83.44]:41983) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VRvHd-0007yj-Ch for 15294@debbugs.gnu.org; Thu, 03 Oct 2013 22:38:25 -0400 Received: by mail-ee0-f44.google.com with SMTP id b47so1496404eek.3 for <15294@debbugs.gnu.org>; Thu, 03 Oct 2013 19:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=i2pisEj72v4hU6ry6owDZEc18v50oP08FPeLEz0Ya2I=; b=ESq8S01cZKGNGqmVf828lUyXQE0allTI3vlMGh2D67MZxD23GJDJYGK/pVy9OYkf/D JGRB0jmlpZkSH1LQynuzwBixxPkAiz610S7ub/1tuP+BTRGxnDRdzCP7x6JXCELSFvQ4 1FgHhCBhVJS0GwQBUiP3GeFljzpba2Wds3y3YbPWwRsNeoq54xdPLVCXu362J1wkW9a+ eJc+WTsQVjFGX8wkEUnj08TmgpvujBMVY30sF8Dgrxs3xktQKmtx1qDqdycUI2RAQcGp ulDcLaPyqNBlZEKQ27I/fJ/cXG86rnmNSsUYbIhKrtADC3wtcrdpyN4fQj3qMzp4oq8q DvfA== X-Received: by 10.14.218.197 with SMTP id k45mr17858047eep.32.1380854304124; Thu, 03 Oct 2013 19:38:24 -0700 (PDT) Received: from [192.168.10.2] (93-113-74.netrun.cytanet.com.cy. [93.109.113.74]) by mx.google.com with ESMTPSA id f49sm22416499eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 19:38:23 -0700 (PDT) Message-ID: <524E2A1C.7000909@yandex.ru> Date: Fri, 04 Oct 2013 05:38:20 +0300 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 03.10.2013 08:00, Stefan Monnier wrote: > You can try setting byte-compile--use-old-handlers to nil now to see if > it fixes your performance problems. Indeed, I see the same peformance improvement you wrote about: 0.60s in byte-compiled dynamic binding mode, and now 0.48s in byte-compiled lexical binding mode. Thanks! Not sure if I should close this issue now or at least wait until byte-compile--use-old-handlers is nil by default. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 09:52:46 2013 Received: (at 15294) by debbugs.gnu.org; 4 Oct 2013 13:52:46 +0000 Received: from localhost ([127.0.0.1]:53487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VS5oD-0000mE-EJ for submit@debbugs.gnu.org; Fri, 04 Oct 2013 09:52:45 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:63971) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VS5oB-0000m6-5L for 15294@debbugs.gnu.org; Fri, 04 Oct 2013 09:52:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFLd/fx/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFFLd/fx/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34744347" Received: from 75-119-247-241.dsl.teksavvy.com (HELO pastel.home) ([75.119.247.241]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Oct 2013 09:49:14 -0400 Received: by pastel.home (Postfix, from userid 20848) id DF8C760314; Fri, 4 Oct 2013 09:52:40 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> <524E2A1C.7000909@yandex.ru> Date: Fri, 04 Oct 2013 09:52:40 -0400 In-Reply-To: <524E2A1C.7000909@yandex.ru> (Dmitry Gutov's message of "Fri, 04 Oct 2013 05:38:20 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Not sure if I should close this issue now or at least wait until > byte-compile--use-old-handlers is nil by default. Your call. I'm not completely sure when we should change it: setting it to nil will mean that pretty much any file compiled with the new Emacs won't run on older Emacsen. I think I'd like to see 24.4 release before making the change. But please do set it in your .emacs ASAP so it gets wider testing. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 23:27:27 2013 Received: (at 15294) by debbugs.gnu.org; 5 Oct 2013 03:27:27 +0000 Received: from localhost ([127.0.0.1]:55143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSIWc-0004WL-QC for submit@debbugs.gnu.org; Fri, 04 Oct 2013 23:27:27 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:53806) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSIWb-0004WD-0e for 15294@debbugs.gnu.org; Fri, 04 Oct 2013 23:27:25 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so2186002eek.1 for <15294@debbugs.gnu.org>; Fri, 04 Oct 2013 20:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=QwwVgcgFxa0F4Q155qq6NUvDmMjFSD7fszKE/YvZz4k=; b=b/LAVcwMrPho2ltcmaas7v5T+kVe3m44BcABUhJTVpf6N+SGfG5S5FTbC5zkEEPN19 5tGECCuP49bjbIK0C6MjB1UlVGedmLXjs+QMJN1t0XPK9z6O7gA82o2Gqy/yXKChUic+ 2iJmkXDHzZeq2DIm2VOl+AGBDo3YipAoQifxAIL2hcFBFajGxesrDvcy67NmWSaOnCCT 6u/rWJ8Skzj9mjG/YF3ka/RbwUVXisT8GQbKT8P2D4/PeQWKLbarNCsmY8DV6nKzhKC/ aFn/JlWkhrUb143Lap09TvumEGRc0wx5cxB23fHTmKiUmaabSGf8a+KrA3oHhWCkvBKJ JNkA== X-Received: by 10.14.5.3 with SMTP id 3mr150713eek.49.1380943644096; Fri, 04 Oct 2013 20:27:24 -0700 (PDT) Received: from [192.168.10.2] (93-113-74.netrun.cytanet.com.cy. [93.109.113.74]) by mx.google.com with ESMTPSA id f49sm34857961eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 20:27:23 -0700 (PDT) Message-ID: <524F8717.3090301@yandex.ru> Date: Sat, 05 Oct 2013 06:27:19 +0300 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> <524E2A1C.7000909@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 04.10.2013 16:52, Stefan Monnier wrote: >> Not sure if I should close this issue now or at least wait until >> byte-compile--use-old-handlers is nil by default. > > Your call. I'm not completely sure when we should change it: setting it > to nil will mean that pretty much any file compiled with the new Emacs > won't run on older Emacsen. I think I'd like to see 24.4 release before > making the change. No problem, guess then I'll leave this open until then. I'll do the code reshuffling discussed earlier, but actually having a performance improvement will be a better reason to switch to lexical binding. > But please do set it in your .emacs ASAP so it gets wider testing. Good idea, done. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 14 07:32:12 2014 Received: (at 15294) by debbugs.gnu.org; 14 Dec 2014 12:32:12 +0000 Received: from localhost ([127.0.0.1]:45301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y08LL-0003Y7-KK for submit@debbugs.gnu.org; Sun, 14 Dec 2014 07:32:11 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:42187) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y08LJ-0003Xu-Jl for 15294@debbugs.gnu.org; Sun, 14 Dec 2014 07:32:10 -0500 Received: by mail-wg0-f53.google.com with SMTP id l18so12552950wgh.12 for <15294@debbugs.gnu.org>; Sun, 14 Dec 2014 04:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=odUX86imyzi7VQLvOUrB33S0HROhBta3vb6kBIhjCzY=; b=MmV27UqLqr5LigyFQus7j24YNu81AqluuULQNGQjOPzmzf7ULy/n/931GJjzNmXomu YsbfklGf3UISOGPMSawb5ZRl1N6LkkvcPviL5QIvA5ArgM2QH/xsRQqSPy+saqVxC030 pSmjz4kmSx5L18i455jXHAezZ824CrRY0jya6xolFZWzan0bRg0GeXYEF6jVv9GG1kMQ CBUhZetY48AU7paJGGvRrEgTv12+lkmETUdALSqnBfgBnhIL4LHmLmZVDFDv+utEdNd1 tVPUb9rw2ZBK/WqXG1i/H8GV17Xli1zIPhT99a2MTK52Oa46nGBVFarxI4zcL3gEug45 O0XA== X-Received: by 10.180.228.101 with SMTP id sh5mr22768055wic.62.1418560324059; Sun, 14 Dec 2014 04:32:04 -0800 (PST) Received: from axl ([82.102.93.58]) by mx.google.com with ESMTPSA id 18sm8987688wjr.46.2014.12.14.04.32.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 14 Dec 2014 04:32:03 -0800 (PST) From: Dmitry Gutov To: Stefan Monnier Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> <524E2A1C.7000909@yandex.ru> Date: Sun, 14 Dec 2014 14:31:57 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 04 Oct 2013 09:52:40 -0400") Message-ID: <86fvcio1j6.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 15294 Cc: 15294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) Stefan Monnier writes: >> Not sure if I should close this issue now or at least wait until >> byte-compile--use-old-handlers is nil by default. > won't run on older Emacsen. I think I'd like to see 24.4 release before > making the change. But please do set it in your .emacs ASAP so it gets > wider testing. Just a reminder: I've been running with that setting for a while now, with no problems that I can remember. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 14 09:08:30 2014 Received: (at 15294-done) by debbugs.gnu.org; 14 Dec 2014 14:08:30 +0000 Received: from localhost ([127.0.0.1]:45383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y09qY-0000B0-Do for submit@debbugs.gnu.org; Sun, 14 Dec 2014 09:08:30 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y09qW-0000Aj-JE for 15294-done@debbugs.gnu.org; Sun, 14 Dec 2014 09:08:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBg2GOUIM4jDuCCoF4gjeBYiGCdwEBAQ X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBg2GOUIM4jDuCCoF4gjeBYiGCdwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="101335100" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Dec 2014 09:08:23 -0500 Received: by pastel.home (Postfix, from userid 20848) id 0EBC2175E; Sun, 14 Dec 2014 09:08:23 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#15294: 24.3.50; js2-mode parser is several times slower in lexical-binding mode Message-ID: References: <871u51ll93.fsf@yandex.ru> <87y56p78u5.fsf@yandex.ru> <524E2A1C.7000909@yandex.ru> <86fvcio1j6.fsf@yandex.ru> Date: Sun, 14 Dec 2014 09:08:23 -0500 In-Reply-To: <86fvcio1j6.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 14 Dec 2014 14:31:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15294-done Cc: 15294-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >>> Not sure if I should close this issue now or at least wait until >>> byte-compile--use-old-handlers is nil by default. >> won't run on older Emacsen. I think I'd like to see 24.4 release before >> making the change. But please do set it in your .emacs ASAP so it gets >> wider testing. > Just a reminder: I've been running with that setting for a while now, So have I. > with no problems that I can remember. Well, I fixed a bug in it a while ago (some issue with "volatile", fixed before the 24.4 release), but other than that, indeed it works fine. The default value has been changed in "master" a couple months ago, already. Stefan From unknown Sat Sep 06 14:23:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 12 Jan 2015 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator