in reply to Re^3: XS: SvPVLV examples?
in thread XS: SvPVLV examples?

How about the even faster:++ u8( $mmap, 0x12346789abcd );

or faster and simpler

my $uchar = u8( $mmap, 0x12346789abcd ); ++$$uchar if cond; $$uchar *= 3;

I've seen much deeper threads and never seen it as a problem.


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 PCW It is as I've been saying!(Audio until 20090817)

Replies are listed 'Best First'.
Re^5: XS: SvPVLV examples?
by ikegami (Patriarch) on Sep 26, 2009 at 01:47 UTC
    Even then, I bet avoiding magic is still faster.
    my $byte = u8( $mmap, 0x12346789abcd ); ++$byte if cond; u8( $mmap, 0x12346789abcd, $byte * 3 );

    If you search PM, you'll find benchmarks between 4-arg and l-lvalue substr. I don't remember how much slower the latter is, but it's quite a bit slower.