From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (8.9.3+3.2W/8.9.3/Debian 8.9.3-21) with ESMTP id QAA24741; Fri, 2 Aug 2002 16:11:59 +0900 Received: from tonton.nagaokaut.ac.jp (tonton [133.44.2.115]) by kankan.nagaokaut.ac.jp (8.11.3/8.11.3) with ESMTP id g727Cq198014; Fri, 2 Aug 2002 16:12:52 +0900 (JST) (envelope-from ruby-core-admin@ruby-lang.org) Received: (from root@localhost) by tonton.nagaokaut.ac.jp (8.11.3/8.11.3) id g727CqM94811; Fri, 2 Aug 2002 16:12:52 +0900 (JST) (envelope-from ruby-core-admin@ruby-lang.org) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by tonton.nagaokaut.ac.jp (8.11.3/8.11.3av) with ESMTP id g727Cp594804; Fri, 2 Aug 2002 16:12:51 +0900 (JST) (envelope-from ruby-core-admin@ruby-lang.org) Received: from helium.ruby-lang.org (helium.ruby-lang.org [210.251.121.214]) by voscc.nagaokaut.ac.jp (8.12.5/8.12.5) with ESMTP id g727Cma3031701; Fri, 2 Aug 2002 16:12:49 +0900 (JST) (envelope-from ruby-core-admin@ruby-lang.org) Received: from helium.ruby-lang.org (localhost [127.0.0.1]) by helium.ruby-lang.org (Postfix) with ESMTP id 2B4501610; Fri, 2 Aug 2002 16:12:46 +0900 (JST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by helium.ruby-lang.org (Postfix) with SMTP id 3600A1576 for ; Fri, 2 Aug 2002 16:12:43 +0900 (JST) Received: (qmail 334 invoked by uid 0); 2 Aug 2002 07:12:39 -0000 Received: from pd954c535.dip.t-dialin.net (HELO lony) (217.84.197.53) by mail.gmx.net (mp011-rz3) with SMTP; 2 Aug 2002 07:12:39 -0000 Date: Fri, 2 Aug 2002 16:12:45 +0900 Posted: Fri, 2 Aug 2002 09:10:26 +0200 From: "Christoph" Reply-To: ruby-core@ruby-lang.org Subject: RE: A truth? patch + benchmarks To: Message-Id: <000001c239f3$ae3c78b0$0100a8c0@lony> In-Reply-To: <1028185375.463992.10420.nullmailer@picachu.netlab.jp> X-ML-Name: ruby-core X-Mail-Count: 00285 X-MLServer: fml [fml 3.0pl#17]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Microsoft Outlook, Build 10.0.3416 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Precedence: bulk X-Virus-Scanned: by AMaViS perl-10 > -----Original Message----- > From: Yukihiro Matsumoto [mailto:matz@ruby-lang.org] > Sent: Thursday, August 01, 2002 9:03 AM > To: ruby-core@ruby-lang.org > Subject: Re: A truth? patch + benchmarks > > Hi, > > In message "RE: A truth? patch + benchmarks" > on 02/08/01, "Christoph" writes: > > |> Not really sure but the values < 64 reserved for T_MASK > |> > |> #define T_NIL 0x01 > |> #define T_OBJECT 0x02 > |> [etc] > |> #define T_NODE 0x3f > |> > |> #define T_MASK 0x3f > | > |Hm, what about using FL_USER7? More generally, is there any > |unused flag left? > > Unfortunately, there's no bit available for all objects. All flag > bits are used to represent NODEs' line number. To bad ... but maybe we might see something like it in 2.0? (or even better body smatter cooks something up for the current development line - maybe only replace the RTEST calls in the crucial IF_NODE, WHILE_NODE ... part?) > > By the way, I still don't know why the inlined function is faster than > the simple macro. Does anybody reveal the secret for me? I don't know (besides a not particular helpful ``your compiler always knows best'' ;-). Anyway I run the two tests (on Mswin32) subdividing the macro call RTEST(v) following strategy c) (of my previous post) PURE_TEST(v) = .. original macro call for ruby_verbose and ruby_debug test. and setting the rest of the RTEST(obj) macro calls to static inline int rb_truth_test(VALUE obj) { if (~Qnil & obj) return 1; return 0; } Not surprisingly, this version tested as fast or faster then any of my other test candidates. /Christoph