Nick Ing-Simmons <[EMAIL PROTECTED]> wrote:
> Tim Bunce <[EMAIL PROTECTED]> writes:
> >
> >Perl5 XS/GUTS is the way it is largely because it was designed with
> >performance in mind.
>
> Hmm, maybe in some areas but not others:
> On the one hand the whole PUTBACK/SPAGAIN mess is by overly clever
> attempt to optimize access to "global" variables which compiler
> has a better chance of getting right by itself.
Easily remedied:
#undef dSP
#define dSP dNOOP
#undef PUTBACK
#define PUTBACK NOOP
#undef SPAGAIN
#define SPAGAIN NOOP
#define sp PL_stack_sp
> While on the other hand XS is forced to stuff everything on the stack.
> My main complaint is that XS code is too unlike pp_xxx() and you
> cannot easily call into pp_xxx().
Yep, everything except the dPOPs, dATARGET, etc. stuff should be
factored out and called as a separate function, similar to the way
pp_join uses do_join:
PP(pp_join)
{
djSP; dMARK; dTARGET;
MARK++;
do_join(TARG, *MARK, MARK, SP);
SP = MARK;
SETs(TARG);
RETURN;
}
> >I think Larry did a very good job. My only big
> >worry for perl6 is that, without great care, we'll loose that
> >performance edge in the name of a 'clean API'.
Please everyone accept that we will provide *both* a source *and* a
binary API, so ideally the choice between total chastity and total
incest happens in a single #define.
--
John Tobey, late nite hacker <[EMAIL PROTECTED]>
\\\ ///
]]] With enough bugs, all eyes are shallow. [[[
/// \\\