From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Re: GLIL->C compilation Date: Sat, 20 Nov 2010 00:20:03 +0100 Message-ID: <201011200020.04169.stefan.itampe@gmail.com> References: <201010212223.23822.stefan.itampe@gmail.com> <201011052219.54556.stefan.itampe@gmail.com> <87zkt4vrhn.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 1290209012 11824 80.91.229.12 (19 Nov 2010 23:23:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 19 Nov 2010 23:23:32 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 20 00:23:28 2010 Return-path: Envelope-to: guile-devel@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 1PJaIh-0007vB-DN for guile-devel@m.gmane.org; Sat, 20 Nov 2010 00:23:27 +0100 Original-Received: from localhost ([127.0.0.1]:40433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJaIg-0002TI-3l for guile-devel@m.gmane.org; Fri, 19 Nov 2010 18:23:26 -0500 Original-Received: from [140.186.70.92] (port=57585 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJaEp-0000Jd-0q for guile-devel@gnu.org; Fri, 19 Nov 2010 18:19:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJaEo-0001Z5-0o for guile-devel@gnu.org; Fri, 19 Nov 2010 18:19:26 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:63187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJaEn-0001Yw-SV for guile-devel@gnu.org; Fri, 19 Nov 2010 18:19:25 -0500 Original-Received: by bwz16 with SMTP id 16so4550683bwz.0 for ; Fri, 19 Nov 2010 15:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=EqZb2eCivJeZsbARQElTUj6rxIFK6YkhHPQZ3GA4toM=; b=hdOPJkOaylIvIfFnZBNmiyJINxahq7pkkRK7a2wIQ/Jx6LE3TP7aGfdH9o2AkR23e+ bEvrDLtxII8+gMCGB/Em7fGgO8LrWFYoM713yqrbnuZ7lahrYJf8UjJqS+mxFgtg2rTj XxNvNKUpfCfsyMbrjKJygvL0foX01YFsOFSgc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=V6bpZROKVH13vPmhp2VnDq7dz2ohKCNYW+dwaGVWoCcNIz2aQ9LDcD/EtQ7++ACTyU BcNxjMzb3F5ABdieUbBqjxZNIlacj3QVLXbQ+Vb2+sMtyGqxdyetIrREmmh06ihX2/29 bqc9CKDrFuCJDsx5BRkQcTwmcf5kQHepxK0p4= Original-Received: by 10.204.64.143 with SMTP id e15mr2763430bki.41.1290208762585; Fri, 19 Nov 2010 15:19:22 -0800 (PST) Original-Received: from linux-s4gz.localnet (1-1-1-39a.veo.vs.bostream.se [82.182.254.46]) by mx.google.com with ESMTPS id p34sm1121013bkf.3.2010.11.19.15.19.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Nov 2010 15:19:21 -0800 (PST) User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.4.4; x86_64; ; ) In-Reply-To: <87zkt4vrhn.fsf_-_@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11149 Archived-At: On Saturday, November 20, 2010 12:11:16 am Ludovic Court=C3=A8s wrote: > Hi, >=20 > Stefan Israelsson Tampe writes: > > #include "cfkn.h" > > #define LOCAL_REF(i) fp[i] > > #define LOCAL_SET(i,v) fp[i] =3D (v) > > void cfkn3676(SCM *fp, SCM **spp) > > { > >=20 > > /* setup of environment */ > > SCM *objects, *free, program, *sp, sss[100]; > > sp =3D sss; > > program =3D fp[-1]; > > objects =3D SCM_I_VECTOR_WELTS (SCM_PROGRAM_OBJTABLE (program)); > > free =3D SCM_PROGRAM_FREE_VARIABLES(program); > > /* compiled section */ > >=20 > > LCASE3666: > > goto L3668; > > LCASE3665: > > sp++; *sp =3D LOCAL_REF(1); > > sp++; *sp =3D SCM_I_MAKINUM(0); > > sp-=3D2; if(!scm_is_eq(sp[1],sp[2])) goto L3669; > > sp++; *sp =3D LOCAL_REF(2); >=20 > [...] >=20 > Comparing this to the VM=E2=80=99s bytecode interpreter should show the o= verhead > incurred by instruction dispatch. >=20 > Did you try to measure this? That=E2=80=99d be interesting. >=20 > Thanks, > Ludo=E2=80=99. Yes on one of my machine one loop takes about 6ns for the compiled one and= =20 about 50ns for the bytcode, say a factor of 7-10 for simple tasks, but=20 remember this is for rather trivial work.