From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Should we land Lisp reader optimizations? Date: Tue, 20 Jun 2017 06:12:05 -0400 Message-ID: References: <83y3snx6b7.fsf@gnu.org> <56EA228B-387F-4983-A91E-97ACFE56F42F@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1497953568 1980 195.159.176.226 (20 Jun 2017 10:12:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2017 10:12:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 20 12:12:42 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 1dNG9J-0008SN-4H for ged-emacs-devel@m.gmane.org; Tue, 20 Jun 2017 12:12:41 +0200 Original-Received: from localhost ([::1]:47780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNG9O-0008Ju-2L for ged-emacs-devel@m.gmane.org; Tue, 20 Jun 2017 06:12:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNG8p-0008Jl-MR for emacs-devel@gnu.org; Tue, 20 Jun 2017 06:12:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNG8l-0003yt-No for emacs-devel@gnu.org; Tue, 20 Jun 2017 06:12:11 -0400 Original-Received: from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:34345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNG8l-0003ya-Hy for emacs-devel@gnu.org; Tue, 20 Jun 2017 06:12:07 -0400 Original-Received: by mail-qt0-x233.google.com with SMTP id v20so13718196qtg.1 for ; Tue, 20 Jun 2017 03:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=y9RQNoewjN4JIQt2CU1uHmujASZiIFTT/Yea2kzRnvQ=; b=sLx4uoCVvXXdGC7iJrxpeyocbTrkSTFdcaCCBA1cZQ2J100NtGXZf0xMnmXJMGoSNM bCqPmB/+87dE5xlDa9X1wteBO+WPAXvkGAUyxw40TKDpktCXHIq3MA1XVbO3sCMfLUz6 BsL89w1cURyUtk23WG6Xc/MIFGULiTaVQwj8LFjSYRMuqZzdxrXYCz13EYG+vkRgcjWw ZxboSGfcxTe6mXEmPkcotJq0H73K8bJiQlr8PgKwswakAfcFotr2wag/f1mozoJ0unkl ZP2W2ctzgdN8VMsnSx0NKbfIpYlM2EK2gNNWVrt7hZYEAhUuG7t8J25R33P4mne54Cli c51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=y9RQNoewjN4JIQt2CU1uHmujASZiIFTT/Yea2kzRnvQ=; b=evlsvYutNLqqAcLlGrcmR1lmXRThi7JB9ee0mQ/Fhhu7IVL/GoSTFQHpzw6Ib4g0YP 5EyNpQFeM/NVXFeyTGv+sgzY00dLUqXIg3p9KFVsfBPurRks0vAo3VA6M1Zu/zj+SAnL C5O47IKFuSWaX7pyI/b+JOef3KBtszRGvukjeuZwwBxtwMTgI5uqjFVDHw874aIzjoaQ ZxDHpHZnkk8zyGasSXPg8gVBqew62AutemJq1etfLRqPv8T2YKFBsRpHXIqKUJdgJSwp VDRJFYfFIk2fSvCwpMvcImeH1MEmub4HgfUKdeqnHcmVBtvkCwAwa5VMhJFfiiOO1OUU i5VA== X-Gm-Message-State: AKS2vOzRIYQ/HQdI6oikfTFEwdyZjMwSdrF9mCVVwmAPbqmao1hUl2BV LBZBhnRylUus/LcC X-Received: by 10.237.43.69 with SMTP id p63mr33840314qtd.200.1497953526905; Tue, 20 Jun 2017 03:12:06 -0700 (PDT) Original-Received: from [192.168.23.52] (c-73-253-167-23.hsd1.ma.comcast.net. [73.253.167.23]) by smtp.gmail.com with ESMTPSA id e32sm9041912qte.1.2017.06.20.03.12.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 03:12:06 -0700 (PDT) In-Reply-To: <56EA228B-387F-4983-A91E-97ACFE56F42F@raeburn.org> X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::233 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:215820 Archived-At: I implemented the benchmark =E2=80=9Cread all Lisp forms from a set of = .elc files previously loaded into buffers=E2=80=9D as mentioned in my = earlier email. I used all the .elc files installed by the build, sorted = by name. The test iterated over the whole set of buffers 10 times, = after an untimed initial pass. With unchanged master sources (63ec338) it took 327s and 920 GC passes. I added the change to short-circuit the recursive processing of certain = types (#3); 171s. I added the change to mutate the placeholder for a cons object instead = of doing recursive substitution (#2); 168s. (I think it did better for = me before but maybe it=E2=80=99s specific to dumped.elc.) I added the getc_unlocked change (#1), mainly because other patches I = was testing updated the same code and I wanted to get numbers quickly = without manually updating the patches; 171s. (The test is reading from = buffers, not files, so this is probably just some random run-to-run = variability.) I then pulled in the change to replace the read_objects list with two = hash tables (part of #4); this brought the run time down to 33.4s, = despite an increase to 1049 GC passes. I added the iteration change (#5) and replaced seen_list with a hash = table (other part of #4); no change. This is expected from #5, and the = seen_list change probably requires more #N# values in an expression for = it to be significant. I added the symbol interning change (#8); the run time is down to 24.6s, = with 631 GC passes, and the speedup appears to be mostly from reducing = the GC passes. Overall improvement: 13x reduction in run time, 31% = reduction in GC passes. Remember this is just for parsing the Lisp = expressions, not for evaluating or for reading the bits off the disk. The #N# use for symbols will take some tweaking to make it get used for = normal byte compilation, and then a full bootstrap, so I=E2=80=99ll try = testing that later in the week. I guess that gives a pretty clear indication which changes I should look = at first. Ken=