just for kicks...

                                  Rate map_hex_split_unpack map_ord_and_shift_split map_unpack_shift_mult_and_list map_vec_lists_splice unpack_map_shift_and_list vec_x4_sub woot vec_x4_inline

map_hex_split_unpack            4887/s                   --                    -28%                           -33%                 -33%                      -39%       -63% -75%          -77%
map_ord_and_shift_split         6762/s                  38%                      --                            -8%                  -8%                      -15%       -49% -66%          -69%
map_unpack_shift_mult_and_list  7314/s                  50%                      8%                             --                  -0%                       -8%       -44% -63%          -66%
map_vec_lists_splice            7314/s                  50%                      8%                             0%                   --                       -8%       -44% -63%          -66%
unpack_map_shift_and_list       7952/s                  63%                     18%                             9%                   9%                        --       -40% -60%          -63%
vec_x4_sub                     13175/s                 170%                     95%                            80%                  80%                       66%         -- -33%          -39%
woot                           19728/s                 304%                    192%                           170%                 170%                      148%        50%   --           -9%
vec_x4_inline                  21606/s                 342%                    220%                           195%                 195%                      172%        64%  10%            --

i may be wrong, but for me, Inline::C == XS.

the generated XS file

# index_pl_8d47.xs
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "INLINE.h"

void woot(char *foo) {
        Inline_Stack_Vars;
        Inline_Stack_Reset;
        Inline_Stack_Push(newSViv( (unsigned char)foo[0] >>   4 ));
        Inline_Stack_Push(newSViv( (unsigned char)foo[0] & 0x0f ));
        Inline_Stack_Push(newSViv( (unsigned char)foo1 >>   4 ));
        Inline_Stack_Push(newSViv( (unsigned char)foo1 & 0x0f ));
        Inline_Stack_Done;
}


MODULE = index_pl_8d47  PACKAGE = main

PROTOTYPES: DISABLE


void
woot (foo)
        char *  foo
        PREINIT:
        I32* temp;
        PPCODE:
        temp = PL_markstack_ptr++;
        woot(foo);
        if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
          PL_markstack_ptr = temp;
          XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
        return; /* assume stack size is correct */

the generated .c file

#index_pl_8d47.c
/*
 * This file was generated automatically by xsubpp version 1.9508 from the 
 * contents of index_pl_8d47.xs. Do not edit this file, edit index_pl_8d47.xs instead.
 *
 *      ANY CHANGES MADE HERE WILL BE LOST! 
 *
 */

#line 1 "index_pl_8d47.xs"
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "INLINE.h"

void woot(char *foo) {
        Inline_Stack_Vars;
        Inline_Stack_Reset;
        Inline_Stack_Push(newSViv( (unsigned char)foo[0] >>   4 ));
        Inline_Stack_Push(newSViv( (unsigned char)foo[0] & 0x0f ));
        Inline_Stack_Push(newSViv( (unsigned char)foo1 >>   4 ));
        Inline_Stack_Push(newSViv( (unsigned char)foo1 & 0x0f ));
        Inline_Stack_Done;
}


#line 27 "index_pl_8d47.c"
XS(XS_main_woot)
{
    dXSARGS;
    if (items != 1)
        Perl_croak(aTHX_ "Usage: main::woot(foo)");
    SP -= items;
    {
        char *  foo = (char *)SvPV(ST(0),PL_na);
#line 26 "index_pl_8d47.xs"
        I32* temp;
#line 38 "index_pl_8d47.c"
#line 28 "index_pl_8d47.xs"
        temp = PL_markstack_ptr++;
        woot(foo);
        if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
          PL_markstack_ptr = temp;
          XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
        return; /* assume stack size is correct */
#line 49 "index_pl_8d47.c"
        PUTBACK;
        return;
    }
}

#ifdef __cplusplus
extern "C"
#endif
XS(boot_index_pl_8d47)
{
    dXSARGS;
    char* file = __FILE__;

    XS_VERSION_BOOTCHECK ;

        newXS("main::woot", XS_main_woot, file);
    XSRETURN_YES;
}


In reply to Re: Re: Nybbles take to long (Solved?) by zengargoyle
in thread Nybbles take to long by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.