From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Why is lexical binding so slow? Date: Sun, 02 Jul 2017 18:15:20 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113d38a0c629ed055359a20d" X-Trace: blaine.gmane.org 1499019378 15494 195.159.176.226 (2 Jul 2017 18:16:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2017 18:16:18 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 02 20:16:11 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRjPm-0003gZ-5g for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 20:16:10 +0200 Original-Received: from localhost ([::1]:58864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRjPr-0008LM-8E for ged-emacs-devel@m.gmane.org; Sun, 02 Jul 2017 14:16:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRjPB-0008LD-W2 for emacs-devel@gnu.org; Sun, 02 Jul 2017 14:15:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRjPA-0001Bj-UP for emacs-devel@gnu.org; Sun, 02 Jul 2017 14:15:33 -0400 Original-Received: from mail-oi0-x22c.google.com ([2607:f8b0:4003:c06::22c]:36758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRjPA-0001BJ-NQ for emacs-devel@gnu.org; Sun, 02 Jul 2017 14:15:32 -0400 Original-Received: by mail-oi0-x22c.google.com with SMTP id x187so10919088oig.3 for ; Sun, 02 Jul 2017 11:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Wrau803F5Va1H68HY/YW3DTv0QMlFxP2HVeSSLhW1Dk=; b=k5NIVbGc1PDbO7x47Cs+mCsmj+1dpOWeDKLUKb6tLPlJX0TyuxgxBMhD+R9fF7qS0O 0ukHLJAJsKqOsz/et9PHdOe8qWmdglXtavAbWncd6mtjicdR+PMmg+QgeGuZE0WGadqi gNt9vfdJ0EC0lM49X+mbOIFMK6hfkIR86RAa+clDYB1uo2H5nQd4MxRmDfyTOg2S9XzM r+i3YWDDNyoifzqGTywyHHBwylmdqYc1aMQpy+HWrwbgcfEBDCTyxBU+2QiKhAJOCjOR YiYWHZmApmk8xpv3J3b/jklYRo0f6Lw2+jfhWrXRb8jowPyyQdu/R5XEtvpWyrziDZGw sbbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Wrau803F5Va1H68HY/YW3DTv0QMlFxP2HVeSSLhW1Dk=; b=RdQtBh+7SihSiFKzOV6diwMHLlGzsYYDvdy6Mo6qQd9pa2YGOU0Q5+3Gh/JqmtJRwG /VPOuWf5BQIJsWIwrwBjmyEEcwVijDD2sFtO78dRX4QCOdKFutn4qd1A39wMV7bOxt38 5qZyqLOZ42Zc1Zs6x+hdh+kBvJPBajlnPjtktD+6+dsy3EvUHP+PN0mdV960fSUmRHs9 4RQgjePV479Y8LY18vqqUhExlOdb7j8vMRn75+20nzdYFm8ys0kFGmMqeIcKGUrQX40Z UMcTcYUyqy1I/LUxWKj4aIlNLUDjlE8AclyskGrsDeg/2nSaCCmhm6TAad/NDUkVQcbr P9cA== X-Gm-Message-State: AKS2vOzZ8q5q+oLyFwUPJTr5JUleurmZQ2P3mca8DYBKTFXxM0iSL3ns LZkZcLVCCHFD8Vy4c74BlkfvK0CjNGsn X-Received: by 10.202.224.70 with SMTP id x67mr16094338oig.75.1499019331642; Sun, 02 Jul 2017 11:15:31 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216121 Archived-At: --001a113d38a0c629ed055359a20d Content-Type: text/plain; charset="UTF-8" Hi, the manual states ( https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html ): "Lexical binding opens up many more opportunities for optimization, so programs using it are likely to run faster in future Emacs versions." However, in practice, at least some libraries are significantly slower with lexical binding, cf. https://github.com/mooz/js2-mode/issues/426#issuecomment-312506855. Why is that? Shouldn't code compiled with lexical binding be at least as fast as code compiled with dynamic binding? Philipp --001a113d38a0c629ed055359a20d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

"Lexical binding opens up many more opportunities = for optimization, so programs using it are likely to run faster in future E= macs versions."
However, in practice, at least some librarie= s are significantly slower with lexical binding, cf.=C2=A0https://githu= b.com/mooz/js2-mode/issues/426#issuecomment-312506855.
Why is= that? Shouldn't code compiled with lexical binding be at least as fast= as code compiled with dynamic binding?

Philipp
--001a113d38a0c629ed055359a20d--