From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.devel Subject: Re: Execution speed Date: Mon, 20 Mar 2017 11:49:33 +1300 Message-ID: References: <87lgs13wz2.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1489964303 3173 195.159.176.226 (19 Mar 2017 22:58:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Mar 2017 22:58:23 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 19 23:58:17 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 1cpjm1-0007Pg-6b for ged-emacs-devel@m.gmane.org; Sun, 19 Mar 2017 23:58:05 +0100 Original-Received: from localhost ([::1]:58428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpjm7-0002jL-Cr for ged-emacs-devel@m.gmane.org; Sun, 19 Mar 2017 18:58:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpjm0-0002j0-8W for emacs-devel@gnu.org; Sun, 19 Mar 2017 18:58:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpjlw-000261-Cs for emacs-devel@gnu.org; Sun, 19 Mar 2017 18:58:04 -0400 Original-Received: from [219.88.242.59] (port=36768 helo=mail.orcon.net.nz) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpjlv-00025s-Rh for emacs-devel@gnu.org; Sun, 19 Mar 2017 18:58:00 -0400 Original-Received: from [192.168.20.100] ([150.107.175.196]) (authenticated bits=0) by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id v2JMnXAH023200 for ; Mon, 20 Mar 2017 11:49:34 +1300 In-Reply-To: <87lgs13wz2.fsf@users.sourceforge.net> X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined, tokens from: outbound) X-CanIt-Geo: ip=150.107.175.196; country=NZ; region=Bay of Plenty; city=Tauranga; latitude=-37.6861; longitude=176.1667; http://maps.google.com/maps?q=-37.6861,176.1667&z=6 X-CanItPRO-Stream: base:outbound X-Canit-Stats-ID: 02SVWNxHe - b52f9867bc7f - 20170320 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 219.88.242.59 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:213168 Archived-At: Using npostavs's code: | DYNAMIC | interpreted | compiled -------------------------------------------------------------------- 25.2 | recursive | 1.55s | 0.94s | iterative | 1.70s | 1.06s -------------------------------------------------------------------- 25.1 | recursive | 1.53s | 0.95s | iterative | 1.87s | 1.06s -------------------------------------------------------------------- 24.5 | recursive | 1.65s | 1.24s | iterative | 1.43s | 0.95s -------------------------------------------------------------------- 24.4 | recursive | 1.78s | 1.25s | iterative | 1.59s | 1.02s -------------------------------------------------------------------- | LEXICAL | interpreted | compiled -------------------------------------------------------------------- 25.2 | recursive | 4.27s (2.22s in 506 GCs) | 0.64s (0.03s in 6 GCs) | iterative | 1.56s (0.10s in 23 GCs) | 0.49s (0.03s in 6 GCs) -------------------------------------------------------------------- 25.1 | recursive | 4.26s (2.21s in 506 GCs) | 0.64s (0.03s in 6 GCs) | iterative | 1.58s (0.10s in 23 GCs) | 0.50s (0.03s in 6 GCs) -------------------------------------------------------------------- 24.5 | recursive | 4.11s (2.14s in 507 GCs) | 0.92s (0.03s in 6 GCs) | iterative | 1.57s (0.09s in 22 GCs) | 0.84s (0.03s in 7 GCs) -------------------------------------------------------------------- 24.4 | recursive | 4.20s (2.08s in 506 GCs) | 0.91s (0.03s in 6 GCs) | iterative | 1.65s (0.10s in 23 GCs) | 0.82s (0.03s in 6 GCs) -------------------------------------------------------------------- Running as: emacs -Q --batch -l /tmp/gcd-benchmark-dynamic.el --eval '(progn (gcd-dynamic-benchmarks) (princ (buffer-string)))' emacs -Q --batch -l /tmp/gcd-benchmark-lexical.el --eval '(progn (gcd-lexical-benchmarks) (princ (buffer-string)))' On 20/03/17 08:09, npostavs@users.sourceforge.net wrote: > On Sun, Mar 19, 2017 at 11:12 AM, Stefan Monnier wrote: > >> the other one is my locally built&hacked version with debugging >> assertions and stuff. > > Is that the one that sets lexical-binding always? According to my > measurements, the iterative case is slower on Emacs 25 when using > dynamic binding. With lexical binding, the recursive case is always > slower. > > (Note the measurements below are using unoptimized -O0 builds, with > extra checking enabled) > > GNU Emacs 24.5.5 (x86_64-unknown-linux-gnu, X toolkit) of 2017-02-12 on zony > > | DYNAMIC | interpreted | compiled | > |-----------+-------------+----------| > | recursive | 7.64s | 5.61s | > | iterative | 7.91s | 4.24s | > > | LEXICAL | interpreted | compiled | > |-----------+----------------------------+------------------------| > | recursive | 21.82s (12.20s in 470 GCs) | 4.73s (0.15s in 6 GCs) | > | iterative | 8.87s (0.54s in 21 GCs) | 3.14s (0.15s in 6 GCs) | > > GNU Emacs 25.2.6 (x86_64-unknown-linux-gnu, X toolkit) of 2017-03-01 > > | DYNAMIC | interpreted | compiled | > |-----------+-------------+----------| > | recursive | 10.58s | 6.39s | > | iterative | 14.05s | 6.72s | > > | LEXICAL | interpreted | compiled | > |-----------+----------------------------+------------------------| > | recursive | 35.44s (20.56s in 448 GCs) | 4.35s (0.28s in 6 GCs) | > | iterative | 13.20s ( 0.92s in 20 GCs) | 2.96s (0.23s in 5 GCs) | > >