Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Dual boot (i.e. same hardware), Ubuntu 17.10, Win10, threaded Perl 5.26 both. However, it seems some (default) flags (compiler options?) are set wrong for Inline::C on Windows. Here's output of no-op example for both systems:

$ perl -MTime::HiRes=time -MInline=C,'void foo(){}' -wE'$t=time;foo()f +or 1..1e8;say time-$t' 5.57836294174194 $ perl -MTime::HiRes=time -wE'$t=time;sub foo(){}foo()for 1..1e8;say t +ime-$t' 5.003093957901 >perl -MTime::HiRes=time -MInline=C,"void foo(){}" -wE"$t=time;foo()fo +r 1..1e8;say time-$t" 11.325471162796 >perl -MTime::HiRes=time -wE"$t=time;sub foo(){}foo()for 1..1e8;say ti +me-$t" 5.04568600654602

The use of Inline::C for particular case, where I noticed that, is exactly for huge number of calls of very simple sub (but not no-op, of course). I understand sub calls in Perl are expensive, I'll live with that, but I don't understand the result above.

To counter "it's because Linux is better", the script was moved from very old 32-bit Windows machine, and I noticed (though can't provide any solid numbers right now), that benchmarks for pure-Perl parts showed perhaps 6-fold speed improvement, while the main part, in C, no more than 2-fold. Therefore I have a suspicion about sub-optimal Inline::C defaults there, and i hope for hints of what could be changed.


In reply to Inline::C on Windows: how to improve performance of compiled code? by vr

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 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? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2022-08-10 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?