unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Cc: 41194@debbugs.gnu.org
Subject: bug#41194: 28.0.50; [feature/native-comp] fibn benchmark exhausts memory
Date: Tue, 09 Jun 2020 22:24:45 +0000	[thread overview]
Message-ID: <xjfo8prx4gi.fsf@sdf.org> (raw)
In-Reply-To: <87y2pyi4gq.fsf@gmail.com> ("Kévin Le Gouguec"'s message of "Mon, 11 May 2020 22:47:33 +0200")

Kévin Le Gouguec <kevin.legouguec@gmail.com> 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.  

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).

-- 
akrl@sdf.org





  reply	other threads:[~2020-06-09 22:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 20:47 bug#41194: 28.0.50; [feature/native-comp] fibn benchmark exhausts memory Kévin Le Gouguec
2020-06-09 22:24 ` Andrea Corallo [this message]
2020-06-10  7:55   ` Kévin Le Gouguec
2020-06-13 15:00     ` Andrea Corallo
2020-06-13 18:17       ` Kévin Le Gouguec
2020-06-14 15:19       ` Kévin Le Gouguec
2020-06-14 16:19         ` Andrea Corallo
2020-06-14 20:47           ` Kévin Le Gouguec
2020-06-14 21:45             ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfo8prx4gi.fsf@sdf.org \
    --to=akrl@sdf.org \
    --cc=41194@debbugs.gnu.org \
    --cc=kevin.legouguec@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).