unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Optimizing vlists
Date: Mon, 13 Aug 2012 18:47:16 +0200	[thread overview]
Message-ID: <87wr1220yz.fsf_-_@gnu.org> (raw)
In-Reply-To: 5024F643.8040706@netris.org

Hello,

Mark H Weaver <mhw@netris.org> skribis:

> Here's one specific data structure idea: we have a "vlist" data
> structure, currently written in Scheme, but in my opinion it would be
> useful to rewrite it in C for better efficiency.

FWIW, I’m not convinced that this is a fruitful approach.

First, because Guile 2.0 has allowed us to write more things in Scheme,
and I’d like to keep it this way.  ;-)

Second, because a very important optimizations would rather be to fiddle
with the GC so that vlists, which are base + offset pairs, would not
have to be heap-allocated, as vlist.scm says:

  ;; XXX: Allocating a <vlist> record in addition to the block at each
  ;; `vlist-cons' call is inefficient.  However, Bagwell's hack to avoid it
  ;; (Section 2.2) would require GC_ALL_INTERIOR_POINTERS, which would be a
  ;; performance hit for everyone.

I remember Andy did some measurements showing that ‘vhash-assoc’ was
often high in the profile when running the compiler.  One thing that
could be done is to run a C-level profiler to see exactly what’s going
on, and which optimizations could help.

WDYT?

Thanks,
Ludo’.




  parent reply	other threads:[~2012-08-13 16:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06 14:50 a passionate guy who want to join in as a developer rushan chen
2012-08-10 11:53 ` Mark H Weaver
2012-08-12 14:31   ` rushan chen
2012-08-13 10:18     ` nalaginrut
2012-08-13 10:41       ` Tristan Colgate
2012-08-13 15:47       ` rushan chen
2012-08-13 16:47   ` Ludovic Courtès [this message]
2012-12-13  8:58   ` Abhinav Jauhri
2012-12-13 15:31     ` Ludovic Courtès
2012-12-13 23:32       ` Abhinav Jauhri

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=87wr1220yz.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).