From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: struct optimizations Date: Mon, 25 Jan 2010 14:34:39 +0100 Message-ID: <874omatij4.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1264427015 15702 80.91.229.12 (25 Jan 2010 13:43:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2010 13:43:35 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 25 14:43:27 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.50) id 1NZPDx-000445-GL for guile-devel@m.gmane.org; Mon, 25 Jan 2010 14:43:25 +0100 Original-Received: from localhost ([127.0.0.1]:39159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZPDy-0001mj-QH for guile-devel@m.gmane.org; Mon, 25 Jan 2010 08:43:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZP5c-000533-4R for guile-devel@gnu.org; Mon, 25 Jan 2010 08:34:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZP5X-0004yD-TK for guile-devel@gnu.org; Mon, 25 Jan 2010 08:34:47 -0500 Original-Received: from [199.232.76.173] (port=40383 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZP5X-0004xx-II for guile-devel@gnu.org; Mon, 25 Jan 2010 08:34:43 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:14497) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1NZP5X-0004nO-3t for guile-devel@gnu.org; Mon, 25 Jan 2010 08:34:43 -0500 X-IronPort-AV: E=Sophos;i="4.49,339,1262559600"; d="scan'208";a="54644468" Original-Received: from laptop-147-210-128-170.labri.fr (HELO nixey) ([147.210.128.170]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 25 Jan 2010 14:34:41 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 =?iso-8859-1?Q?Pluvi=F4se?= an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Andy Wingo's message of "Sun, 24 Jan 2010 18:29:33 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:9919 Archived-At: Hi Andy, Andy Wingo writes: > Some comments: > > -#define SCM_VTABLE_FLAG_RESERVED_0 (1L << 5) > -#define SCM_VTABLE_FLAG_RESERVED_1 (1L << 6) > +#define SCM_VTABLE_FLAG_SIMPLE (1L << 5) /* instances of this vtable= have only "pr" fields */ > +#define SCM_VTABLE_FLAG_SIMPLE_RW (1L << 6) /* instances of this vta= ble have only "pw" fields */ > > The comments do not appear to be correct, given a later check: > > + if (SCM_LIKELY (SCM_VTABLE_FLAG_IS_SET (vtable, SCM_VTABLE_FLAG_SI= MPLE) > + && SCM_VTABLE_FLAG_IS_SET (vtable, SCM_VTABLE_FLAG_SIMPLE_RW) > + && p < SCM_STRUCT_DATA_REF (vtable, scm_vtable_index_size))) > + /* The fast path: HANDLE is a struct with only "p" fields. */ > + data[p] =3D SCM_UNPACK (val); > > It seems that currently SIMPLE is for all pr *or* all pw slots. True. > But we should be more orthogonal than that; let's have SIMPLE be for > having all slots be readable p slots. (Note that this still allows a > mix of readable and writable slots.) > > Then perhaps we can change SIMPLE_RW to be MUTABLE or something, to > indicate that all slots of this object are mutable. > > What do you think? I agree and I=E2=80=99ll look into it. Thanks for the review! Ludo=E2=80=99.