unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org, Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: [PATCH] Configure GMP to use GC allocation functions, remove bignum finalizers
Date: Fri, 02 Dec 2011 18:02:07 +0100	[thread overview]
Message-ID: <877h2enbzk.fsf@gnu.org> (raw)
In-Reply-To: <874nxj8c00.fsf@pobox.com> (Andy Wingo's message of "Fri, 02 Dec 2011 12:10:55 +0100")

Hello!

Andy Wingo <wingo@pobox.com> skribis:

> On Sun 27 Nov 2011 22:25, ludo@gnu.org (Ludovic Courtès) writes:
>
>> A longer term option may be to augment libgc with something akin to our
>> old scm_gc_register_collectable_memory.
>
> This is also necessary, as it turns out.  I added
> scm_gc_register_allocation, which will simply run a GC every so often.
>
> Currently the heuristic is that when GC runs, a counter is reset to be
> equal to the current GC heap size.  scm_gc_register_allocation(size_t)
> decrements this counter.  When it wraps around, we run GC.

OK, sounds good.  I guess scm_gc_register_collectable_memory could be
changed to just call it, ignoring its first argument?

> I made scm_realloc call scm_gc_register_allocation.  I also installed
> custom gmp allocators that call scm_malloc and friends

I was about to say “we can’t do that in 2.0!”, but then saw your
scm_install_gmp_memory_functions trick.  Cool!  :-)

Could you make it SCM_INTERNAL instead of SCM_API?

> That makes the `(factorial 100000)' test take twice as long to run (6
> seconds vs 3 seconds), because GC ran 1000 times instead of 15 times,
> but it kept the memory image size to 18 MB instead of 1800 MB.

Could you check how it affects gc-benchmarks/?  :-)

Thank you for being both an efficient and a brave hacker!

Ludo’.



  reply	other threads:[~2011-12-02 17:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 19:48 [PATCH] Configure GMP to use GC allocation functions, remove bignum finalizers Mark H Weaver
2011-05-31 20:07 ` Mark H Weaver
2011-05-31 21:52 ` Ludovic Courtès
2011-05-31 23:18   ` Neil Jerram
2011-05-31 23:32     ` Neil Jerram
2011-06-01  8:34     ` Andy Wingo
2011-06-02 23:14       ` Ludovic Courtès
2011-11-27 19:33       ` Andy Wingo
2011-11-27 21:25         ` Ludovic Courtès
2011-11-28 22:23           ` Andy Wingo
2011-11-28 23:10             ` Ludovic Courtès
2011-11-28 23:50               ` Andy Wingo
2011-11-29 11:06                 ` Ludovic Courtès
2011-11-29 11:35                   ` Andy Wingo
2011-11-29 13:20                     ` Ludovic Courtès
2011-11-29 12:45                   ` Andy Wingo
2011-11-29 13:18                     ` Ludovic Courtès
2011-11-29 14:44                       ` Andy Wingo
2011-11-29 16:22                         ` Ludovic Courtès
2011-12-02 11:10           ` Andy Wingo
2011-12-02 17:02             ` Ludovic Courtès [this message]
2011-12-02 18:12               ` Andy Wingo
2011-12-02 22:17                 ` Ludovic Courtès
2011-12-03 10:57                   ` Andy Wingo
2011-12-03 17:57                     ` Ludovic Courtès

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/guile/

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

  git send-email \
    --in-reply-to=877h2enbzk.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=neil@ossau.uklinux.net \
    --cc=wingo@pobox.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.
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).