Why is it necessary to call Perl_get_context() 9 times for EVERY CALL to such a simple function?
I think that is
unnecessary and I would expect that those Perl_get_context() calls could be removed by declaring
PRE_HEAD => '#define PERL_NO_GET_CONTEXT 1',
in your scripts "Config" section.
If I don't define PERL_NO_GET_CONTEXT, then for me your script outputs:
Took 0.160126seconds
1000000
With PERL_NO_GET_CONTEXT defined it runs twice as quickly:
Took 0.072088seconds
1000000
(I've ignored the CCFLAGS output that is also produced.)
AIUI,
the problem with defining PERL_NO_GET_CONTEXT in Inline::C scripts is that it causes breakage if any of the Inline::C functions call Perl API functions.
But none of the functions in your script call Perl API functions, so it's ok to define PERL_NO_GET_CONTEXT.
Could it be that the hint that
vr is looking for is simply to "define PERL_NO_GET_CONTEXT" ?
Cheers,
Rob
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.