From: Christoph Date: 2002-08-02T17:54:46+09:00 Subject: RE: A truth? patch + benchmarks > -----Original Message----- > From: ts [mailto:decoux@moulon.inra.fr] > Sent: Friday, August 02, 2002 9:21 AM > To: ruby-core@ruby-lang.org > Cc: ruby-core@ruby-lang.org > Subject: Re: A truth? patch + benchmarks > > >>>>> "C" == Christoph writes: > > C> static inline int > C> rb_truth_test(VALUE obj) > C> { > C> if (~Qnil & obj) return 1; > C> return 0; > C> } > > Well, personnally I've not found a difference between the macro and inline > version (and the assembler generated was the same) Don't know but maybe the compiler sometimes wisely decides not to inline - or does some other type of global optimizations? Anyway the size of the dll are different (vc7)- ls -l ... 794624 Aug 1 18:26 mswin32-ruby17.dll (rb_truth_test version) 791552 Aug 2 09:53 mswin32-ruby17.dll (PURE_RTEST = RTEST) > > C> Not surprisingly, this version tested as fast or faster then > C> any of my other test candidates. > > You are sure that it's not an artefact ? I did not want to (and somehow still don't want to) believe that this isn't an artifact myself. But I am getting these counter intuitive results on several platforms mswin32, mingw32 and cygwin (3.1.1 gcc) and the results seem very consistent (well at least until I, eehm - more likely you, find my setup mistake;-). /Christoph