develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [PATCH] Configure probe for static inline

Thread Previous | Thread Next
Andy Dougherty
July 8, 2010 07:38
Re: [PATCH] Configure probe for static inline
Message ID:
On Thu, 8 Jul 2010, David Golden wrote:

> On Thu, Jul 8, 2010 at 9:24 AM, David Golden <> wrote:
> > On Thu, Jul 8, 2010 at 8:14 AM, H.Merijn Brand <> wrote:
> >> I suggest just committing this and see how smokes react
> >
> > I'm fine with that if it happens now while we're two weeks out from
> > 5.13.3.  We'll have time to watch smokes and back it out if necessary.
> >
> > (By which I mean I'd rather not apply it a week from now.)
> Per IRC discussion with Tux, he'll be offline for a few weeks starting
> next week, so we agreed that we should hold off applying this until
> he's back as part of the 5.13.4 work.

Fair enough.  It's actually quite low risk, since the probe isn't used, 
but I agree it's better not to directly patch Configure, and wait for Tux 
to have a chance to apply the metaconfig unit and regenerate Configure.

Then, we'll still have to figure out what to put in for the Windows and 
VMS folks, since they don't use Configure.

Meanwhile, my preliminary investigations on using PERL_STATIC_INLINE for 
some of the hairier macros in sv.h shows no effect on anything other than 
maintainability.  (I think a single inline function is easier to read, 
write, and maintain than a maze of compiler-specific macros.)

To be specific:  With Sun's C 5.11 compiler (at optimization level -xO3 or 
higher), leaving things as macros, writing them as static, or writing them 
as 'static inline' resulted in essentially the same assembly code for 
sv.c.  (I didn't check all the other files.)  Even without the 'inline' 
hint, the compiler was able to figure out that inlining the function made 
sense and did it anyway.

With Sun's WorkShop Compiler 4.2 (which is C89, and doesn't understand 
"inline"), the compiler still will try to inline the functions (at 
optimization level -xO4 or higher) and the overall performance, as 
measured by perlbench, doesn't seem to vary.

Your mileage may vary, and I still recommend careful testing of any 
proposed changes, but the early signs are encouraging.

    Andy Dougherty

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About