Extended with the C/XS version ...

use Inline "C"; : @dst = uic ($src); print STDERR "uic: (@dst[0..22] ...\n @dst[4073..4095])\n"; cmpthese (-2, { uu => \&uu, upuu => \&upuu, upuu0 => \&upuu0, asu => \ +&asu, mlut => \&mlut, uic => sub { uic ($src); } }); __END__ __C__ void uic (SV *src) { int i = 0; STRLEN l; unsigned char *s = (unsigned char *)SvPV (src, l); inline_stack_vars; inline_stack_reset; while (i < l) { int n = (s[i] >> 2) & 0x3f; inline_stack_push (newSViv (n)); n = (s[i++] & 0x03) << 4; n |= (s[i] >> 4) & 0x0f; inline_stack_push (newSViv (n)); n = (s[i++] & 0x0f) << 2; n |= (s[i] >> 6) & 0x03; inline_stack_push (newSViv (n)); n = s[i++] & 0x3f; inline_stack_push (newSViv (n)); } inline_stack_done; } /* uic */

And the stunning result ...

uu: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) upuu: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) upuu0: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) asu: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) mlut: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) uic: (50 26 62 7 35 6 35 32 50 13 56 19 61 46 55 59 39 14 21 17 16 4 +2 34 ... 51 63 37 34 24 35 11 33 56 63 39 13 19 22 10 0 17 20 54 11 5 4 +7 56) Rate upuu upuu0 mlut asu uu uic upuu 367/s -- -3% -56% -62% -65% -95% upuu0 380/s 3% -- -54% -61% -64% -95% mlut 832/s 127% 119% -- -14% -22% -89% asu 972/s 165% 156% 17% -- -9% -87% uu 1063/s 190% 180% 28% 9% -- -86% uic 7758/s 2014% 1944% 832% 698% 629% --

Enjoy, Have FUN! H.Merijn

In reply to Re: unpacking 6-bit values by Tux
in thread unpacking 6-bit values 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.