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#15294: 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1378501275 26120 80.91.229.3 (6 Sep 2013 21:01:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2013 21:01:15 +0000 (UTC) To: 15294@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 06 23:01:18 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 1VI39Z-0005Dn-HW for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 23:01:17 +0200 Original-Received: from localhost ([::1]:39762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI39Z-0001gX-7b for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 17:01:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI39R-0001gE-9v for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 17:01:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI39L-00049Z-6B for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 17:01:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI39L-00049V-2H for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 17:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VI39K-0008Se-LE for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2013 17:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Sep 2013 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15294 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137850121132404 (code B ref -1); Fri, 06 Sep 2013 21:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Sep 2013 21:00:11 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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-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:78072 Archived-At: 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