What you have shown is XS code compiled using the most inefficient, backwards-compatible mode. If you compile it with ... All those checks ... All those calls ... macros designed for use by XS are less efficient ...

So, what you are saying is, if every XS-dabbling programmer, became an XS expert and learnt all the rules and tricks and techniques; and then they all modified all of their modules and programs, then things would run faster.

Wouldn't it be nice if we had tools that took care of that?

And if a modern C compiler can't cope with a a few extra no-op {} scopes added by perl's macros, there's something wrong with it.

If C compilers were able to optimise away all that stuff, then wouldn't #define PERL_NO_GET_CONTEXT be unnecessary? An effective noop under optimisation?

Compile-time optimisers cannot optimise across compile unit boundaries. C compilers are beginning to do LTO, but at a very limited level.

If you used LLVM simply as an alternative C compiler, it couldn't do much more than modern C compilers do, but it is capable of doing so much more.

Show me some actual assembly of a function in pp_hot.c that's being significantly crippled by the design of perl's macros, and I'll start to take it seriously.

You could show me ...

But who decided what was "hot"? On the basis of tracing what code?

If the functions in pp_hot.c have come in for some special attention that has proven demonstratively worth that effort, isn't it possible that programs that use function outside of pp_hot.c might benefit if the functions they use came in for similar treatment?

And isn't it just possible that a radically different (un-C-like) alternative like LLVM might be able to make pp_hot.c type changes elsewhere, in an automated manner?

And maybe even find other changes that C compilers and programmers wouldn't even consider?

Other than that, everything you've talked about is wild speculation so far.

Agreed. Speculation based on some two years (on and off) of looking at what LLVM can, and is, doing, but still speculation. And clearly labeled as such.

And it will remain that way until someone tries it. (Aren't you in the least bit intrigued?)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

p

In reply to Re^7: Perl 5 Optimizing Compiler, Part 4: LLVM Backend? by BrowserUk
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend? by Will_the_Chill

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.