Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Are monks hibernating?

by syphilis (Archbishop)
on Feb 14, 2007 at 12:30 UTC ( [id://599922]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Are monks hibernating?
in thread Are monks hibernating?

I've investigated writing OO using Inline::C, but even then the wrapping process that mates C to XS to Perl just sucks away most of the performance gains. Writing XS directly can save some of that ...

I see (from time to time) vague allusions to the notion that XS can achieve something that Inline::C cannot - and the above quote is just one more example of that.

But then ... the allusions are so vague that I'm never sure that I've understood correctly :-)

Are you saying that there's some performance improvement to be had by writing XS directly (that can't be achieved with Inline::C) ? If so, could you (or anyone) give an example - more for my own edification, rather than for any other reason.

Given that Inline::C merely autogenerates an XS file, I find it hard to comprehend that the one has any advantage over the other (re performance).

I'll go back to sleep, now :-)

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: Are monks hibernating?
by BrowserUk (Patriarch) on Feb 14, 2007 at 12:58 UTC

    At the very least, using Inline::C adds another layer of subroutine call around the c function. Depending upon what parameters the sub takes and whether you declare them using C types or XS types, the translations in and out can add conversions and casts that can be unnecessary.

    Try comparing the post processed C with your original C function. It can be quite an eye opener.


    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://599922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found