Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
But magic is a dynamic, runtime thing, not something that can be determined at the time an SV is created.

I realise that -- but don't get hung up on my speculations. They are not proposals to be refuted. I'm making them up as I go, based upon the types of things LLVM can do, and my extremely limited knowledge of the internals.

That's exactly why it is important to get someone like you, with your depth of knowledge, to look at LLVM in detail. Once you understand the possibilities, your speculations would be so much more targeted than mine.

cachgrind shows that the tryAMAGICbin_MG() line at the top of pp_add() does 7 instruction reads, 3 data reads and 1 branch per call (with no significant cache or branch predictor fails), while the pp_add() function as a whole does 85 instruction reads. So even if there was some way to know in advance to call a non-magic / non-overload version of pp_add (and I don't think there is) the best improvement you could theoretically achieve is 9%.

So you've shown me an example that (a) can't work, and (b) even if it did, doesn't show me that much could be gained.

Yes. But you've only considered one level deep in a simple opcode. In something like pp_substr there is so much conditional branching and test for magic and utf (and other stuff), on multiple parameters, and then calls to upgrades and ... you know what's in there far better than I

Its not just the single opcodes, but all the calls made from within them that make these types of checks. It is the application of, the wide view that Whole-Program Analysis and LTO and forgetting C language rules, can bring to the table that could be substantial, not beating the human programmer on individual routines.

Programmer reputedly can remember 5 or 7 or 8 things at any given moment; programs can build entire graphs and find patterns spanning those graphs. They don't forget things.

want to be inspired; but I just haven't seen anything yet that indicates we could get more than that 10%.

I think that's because you haven't yet seen the full potential of LLVM, and I'm failing to describe it well enough and my attempts to speculate are clumsy. Please do read the pdf.


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

pmsig

In reply to Re^11: 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found