From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#41194: 28.0.50; [feature/native-comp] fibn benchmark exhausts memory Date: Tue, 09 Jun 2020 22:24:45 +0000 Message-ID: References: <87y2pyi4gq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="58844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 41194@debbugs.gnu.org To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 10 00:25:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jimgF-000FDC-Vu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jun 2020 00:25:15 +0200 Original-Received: from localhost ([::1]:47914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jimgE-0005wp-HH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Jun 2020 18:25:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jimg2-0005wi-5P for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2020 18:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jimg1-0003z2-OG for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2020 18:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jimg1-0005ls-Ig for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2020 18:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jun 2020 22:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41194 X-GNU-PR-Package: emacs Original-Received: via spool by 41194-submit@debbugs.gnu.org id=B41194.159174149122165 (code B ref 41194); Tue, 09 Jun 2020 22:25:01 +0000 Original-Received: (at 41194) by debbugs.gnu.org; 9 Jun 2020 22:24:51 +0000 Original-Received: from localhost ([127.0.0.1]:32911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jimfq-0005lR-Me for submit@debbugs.gnu.org; Tue, 09 Jun 2020 18:24:50 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:58116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jimfn-0005lH-W5 for 41194@debbugs.gnu.org; Tue, 09 Jun 2020 18:24:48 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 059MOjbQ022718 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 9 Jun 2020 22:24:45 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 059MOjsm003227; Tue, 9 Jun 2020 22:24:45 GMT In-Reply-To: <87y2pyi4gq.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Mon, 11 May 2020 22:47:33 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181797 Archived-At: K=C3=A9vin Le Gouguec writes: > As detailed in bug#41077, I compiled the feature/native-comp branch[1] > on a low-end-ish laptop[2], blacklisting char-fold.el since native > compilation took too much memory for this file. > > As reported there, I get appreciable speedups on the benchmarks > distributed in the elisp-benchmarks ELPA package, except for one > specific test: fibn. When native-compiled (with any value of > comp-speed), this test makes Emacs abort with the message: > >> Memory exhausted--use C-x s then exit and restart Emacs > > I've plotted some graphs showing fibn's memory consumption for every > value of comp-speed, as well as for emacs master[3] (where all 3 > iterations run to completion): > > > > See [4] for the methodology, source material and logs. Out of curiosity > I've disassembled the compiled functions in fibn.el for comp-speed 2; > I'm not fluent enough in assembly to spot anything obviously wrong[5]. > > > Let me know if there are things you would like me to try out in order to > investigate this.=20=20 Hi Kevin, sorry for the very late reply I just had a look. The following is going on: being on 32bit system you get into bignums end this allocates memory while is looping inside `elb-fibn'. Unfortunatelly there's no opportunity of passing through maybe_gc to trigger garbage collection because I've not implemented the equivalent of what is the quitcounter in the byte interpreter. I'll come-up with a patch to generate the equivalent code of the quitcounter when compiling for speed < 3. Thanks for the feedback Andrea PS FYI I think memory consumption during compilation (as compile time) should be now considerably lowered (but I've still haven't measured it). --=20 akrl@sdf.org