unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Luca Saiu <positron@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: bug-guile@gnu.org
Subject: Re: High run time variance
Date: Tue, 30 Mar 2010 17:05:09 +0200	[thread overview]
Message-ID: <4BB21325.9020107@gnu.org> (raw)
In-Reply-To: <8739ziynd3.fsf@gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Ludovic.

Ludovic Courtès wrote:
> Hello,
> 
> Luca Saiu <positron@gnu.org> writes:
> 
>> The effect is much weaker in either case, when using tail-recursive
>> functions. This is interesting.
> 
> Another guess: it could be that the non-tail-recursive version fills the
> L2 cache

In the case of fibo I'd say no, as the maximum stack depth is O(n) and
Guile reuses the same stack space over and over again.
Anyway, even if L2 were really filled, why the timing anomaly? Some
event that we don't control takes place *at process start up time*, and
deterministically determines the speed of all the repeated evaluations
taking place later, until the process dies. This thing is intriguing.

> (/sys/devices/system/cpu/cpu0/cache/index2/size says it’s 2 MiB
> on my laptop)

On my machine L2s are 6Mb, 24-way set-associative, one per pair of cores
(there are four L2 caches for eight cores (four per package: I'm
honestly not sure about chips and dies)). Anyway during the experiments
essentially only one core of eight was active.

By the way, am I the only one seeing this effect?  I'd like to try using
OProfile to exploit some hardware event counter for cache faults and the
like. I'm not expert, but I'll look into it.

Thanks,

- --
Luca Saiu
http://www-lipn.univ-paris13.fr/~saiu
GNU epsilon: http://www.gnu.org/software/epsilon
Marionnet:   http://www.marionnet.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuyEyUACgkQvzOavibF0oaUQgCcC4V1HQoLXYlqrzqeOuqTn2ra
DJEAnRCjcLDYjqlBIlBDpIOIcPKnEyCg
=sUjD
-----END PGP SIGNATURE-----




  reply	other threads:[~2010-03-30 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 16:09 High run time variance Luca Saiu
2010-03-30  9:16 ` Ludovic Courtès
2010-03-30 12:35   ` Luca Saiu
2010-03-30 13:01     ` Ludovic Courtès
2010-03-30 15:05       ` Luca Saiu [this message]
2010-08-04 19:51 ` Andy Wingo
2010-08-05 13:42   ` Luca Saiu
2010-08-05 14:45     ` Andy Wingo
2010-08-05 16:21       ` Luca Saiu
2010-08-05 17:43         ` Andy Wingo

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=4BB21325.9020107@gnu.org \
    --to=positron@gnu.org \
    --cc=bug-guile@gnu.org \
    --cc=ludo@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).