From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Lexical binding: why? Date: Tue, 28 May 2019 16:46:31 +0300 Message-ID: <1335faa5-dba6-97bf-74ee-3ba09eb0137f@yandex.ru> References: <20190528100850.GA5296@ACM> <1df3afde-497e-bb67-9cce-5c5d7e5887a6@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="182382"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 28 15:48:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVcSo-000lJl-Vw for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 15:48:27 +0200 Original-Received: from localhost ([127.0.0.1]:35303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVcSn-0000HV-L8 for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 09:48:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVcR4-0008Ix-OU for emacs-devel@gnu.org; Tue, 28 May 2019 09:46:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVcR3-0004l4-R9 for emacs-devel@gnu.org; Tue, 28 May 2019 09:46:38 -0400 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:37961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVcR2-0004iq-50 for emacs-devel@gnu.org; Tue, 28 May 2019 09:46:37 -0400 Original-Received: by mail-wm1-x330.google.com with SMTP id t5so2943010wmh.3 for ; Tue, 28 May 2019 06:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ukazSrhgRvGATYvuOJhK6ssuJeRxKds7zj71QWy7AQc=; b=UB/4CjN2WWQt0F7/Xmy/Bl/M5Nth+WqZ+MUKU3PNguQ4IodSQX6DtX+o4fGs56qa1t O3mLVnSgAarKkikzTAtg33PRrnqW5aC5FKExye+NFhL+gTh0DJyb1nTQNGMt61t3R1KB pmL7iDqhvb0KK2fwDs+qinF+GT/xGVYgGOS3hu6SrLy45znX5ZnGXH37MDK+AhVCvF1I ip8/xW4Jm/IYlYTZ01QR4O99wfzwGRvdvPnl/dXVAe2afKOBGtnJmEy/Od+5jsDf74Aa m+rvMFXUakpRgwBZkOSBd72QXc8QIjT38SGSP25Ej7Urin+1FjqYsSVFEiOaQQ1QOX3g w7rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ukazSrhgRvGATYvuOJhK6ssuJeRxKds7zj71QWy7AQc=; b=fkXvPyVXB4rEPNgNbp+glA8XBnWrg9a5uhhhZ5wfnYuGyjKZyPsYtJYasLmlrUoGoT SgQMz05DBKeZq2juKV+mni6Q2QTDt6OrNPcEt30BmsPghK+4tGXkONev0S9xZyUN5HBE Jrhw7W1G4gqhKobXAqRon9mLLA/Pv86aJLixwjhXQ0hpfWEUae3vVyUTLq1mMZhwKhyI yygHySJ7AQg6e2//ukyWbKvZwrNo0yYvPMmdJrBtkn0NXIjCSg+sZ9FDK/0ntkPPvouT wwqoB01PgaqFWDUWZbkb8TE7tyRb4erp9Qgu7Jq6TtygU1cT3Ke/7yCjMnGbv22bxiNn fl1Q== X-Gm-Message-State: APjAAAXYsSgFvvZ7dCirGnLZcvlC32So9JQcChVY2+POz9ig4leWomDP V27E7fLfZoSODS5lIPpZI7mWwQjB X-Google-Smtp-Source: APXvYqz70I0qz3rk+rQk3jJWoNx3ZdQYMGmj4eEUu1h76weq9ODHXFHN6SZ6YiRSQOzNbTL+Oj9M/A== X-Received: by 2002:a1c:20c9:: with SMTP id g192mr3472833wmg.76.1559051194568; Tue, 28 May 2019 06:46:34 -0700 (PDT) Original-Received: from [192.168.0.195] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id t15sm3254223wmt.2.2019.05.28.06.46.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 06:46:33 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 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:237099 Archived-At: On 28.05.2019 16:25, Stefan Monnier wrote: > Maybe the speed up I remember was linked to the rework I suggested back > then to work around the poor lexical-scoping performance (mainly moving > a condition-case outside of a loop, IIRC) and that actually improved > performance with both lexical and dynamic binding? No, you remembered correctly: without the new byte-code, the situation was noticeably worse. Though maybe it was a 'throw' inside a loop with 'catch' outside it. The 10% figure I just got from this thread: https://github.com/mooz/js2-mode/issues/524#issuecomment-483010120 But it's actually comparing against an older js2-mode version, not against the current code in dynamic-binding mode. I don't have time to redo the measurements now myself, but thinking back, maybe the result of the byte-code introduction was that lexical-binding became slightly faster than dynamic, though not by much.