RE: A truth? patch + benchmarks

From: "Christoph" <chr_news@...>
Date: 2002-08-02 08:54:46 UTC
List: ruby-core #287

> -----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  <chr_news@gmx.net> 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

In This Thread