From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Saiu Newsgroups: gmane.lisp.guile.bugs Subject: Re: High run time variance Date: Tue, 30 Mar 2010 17:05:09 +0200 Message-ID: <4BB21325.9020107@gnu.org> References: <4BB0D0A7.7080505@gnu.org> <87vdce186i.fsf@gnu.org> <4BB1EFFD.4080206@gnu.org> <8739ziynd3.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1269961855 13350 80.91.229.12 (30 Mar 2010 15:10:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 15:10:55 +0000 (UTC) Cc: bug-guile@gnu.org To: =?UTF-8?B?THVkb3ZpYyBDb3VydMOocw==?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Mar 30 17:10:49 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwd5Z-0002NK-Dx for guile-bugs@m.gmane.org; Tue, 30 Mar 2010 17:10:46 +0200 Original-Received: from localhost ([127.0.0.1]:35702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwd5Y-0003cg-Ck for guile-bugs@m.gmane.org; Tue, 30 Mar 2010 11:10:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nwd4Q-00032F-Vy for bug-guile@gnu.org; Tue, 30 Mar 2010 11:09:35 -0400 Original-Received: from [140.186.70.92] (port=48721 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwd4P-000314-7J for bug-guile@gnu.org; Tue, 30 Mar 2010 11:09:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nwd4N-0007e6-6D for bug-guile@gnu.org; Tue, 30 Mar 2010 11:09:33 -0400 Original-Received: from mail.lipn.univ-paris13.fr ([194.254.163.24]:36243) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwd4N-0007e2-1L; Tue, 30 Mar 2010 11:09:31 -0400 Original-Received: from [10.10.0.234] (optimum.lipn.univ-paris13.fr [10.10.0.234]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiu@lipn.univ-paris13.fr) by mail.lipn.univ-paris13.fr (sendmail 8.9.3/8.9.2) with ESMTP id 33FE522E38; Tue, 30 Mar 2010 17:09:30 +0200 (CEST) User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) In-Reply-To: <8739ziynd3.fsf@gnu.org> X-Enigmail-Version: 0.95.0 OpenPGP: id=26C5D286; url=http://www-lipn.univ-paris13.fr/~saiu/lucasaiu.asc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4550 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Ludovic. Ludovic Court=C3=A8s wrote: > Hello, >=20 > Luca Saiu writes: >=20 >> The effect is much weaker in either case, when using tail-recursive >> functions. This is interesting. >=20 > Another guess: it could be that the non-tail-recursive version fills th= e > 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=E2=80=99s 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 =3DsUjD -----END PGP SIGNATURE-----