unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: guile-devel@gnu.org
Subject: Re: marking overhead, and on the cost of conditionals in hot code
Date: Mon, 19 Jan 2009 01:35:53 -0200	[thread overview]
Message-ID: <gl0seq$i3p$1@ger.gmane.org> (raw)
In-Reply-To: <m363kezzbi.fsf@pobox.com>

Andy Wingo escreveu:
> I dropped into cachegrind, and it tells me thing about scm_gc_mark in a
> simple guile -c 1 run:
> 

> 
> I think that the items on the left are cycle counts, and are of relative
> importance. The => lines are the cumulative costs of the subroutines.
> 
> The salient point for me is that the scm_i_marking check slows down
> this function by about 10%! 

This can easily be remedied by splitting off the actual work into internal 
function which skips the check.  The GC module could alway call the internal 
function.

> Also, that the majority of the time in this
> function is in the SCM_GC_MARK_P line.

Well, GC_MARK_P is bit fiddling a pointer dereference, with a possible cache miss.

Also, the code up to that point will get executed much more often than what follows. 

-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen





      parent reply	other threads:[~2009-01-19  3:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 22:00 marking overhead, and on the cost of conditionals in hot code Andy Wingo
2009-01-17 18:48 ` Neil Jerram
2009-01-17 22:37   ` Ludovic Courtès
2009-01-17 22:30 ` Ludovic Courtès
2009-01-19  3:35 ` Han-Wen Nienhuys [this message]

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='gl0seq$i3p$1@ger.gmane.org' \
    --to=hanwen@xs4all.nl \
    --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).