in reply to Re: Interleaving bytes in a string quickly
in thread Interleaving bytes in a string quickly
I had to tweak the 5.6 solution a bit:
ike510 => q[ ( my $out = $in ) =~ s/.\K/\x40/sg; print 'ike510', unpack 'C20', $out if DEBUG;; ], ike5_6 => q[ ( my $out = $in ) =~ s/(.)/$1\x40/sg; print 'ike5.6', unpack 'C20', $out if DEBUG;; ],
But the answer to the quesion is 'not well':
Rate ike5_6 ike510 buk shmem salva jmac lanX fletch ike5_6 0.882/s -- -30% -56% -68% -73% -90% -91% -100% ike510 1.26/s 43% -- -37% -54% -61% -85% -88% -100% buk 1.99/s 126% 58% -- -28% -39% -76% -81% -99% shmem 2.77/s 214% 120% 39% -- -15% -67% -73% -99% salva 3.25/s 269% 158% 63% 17% -- -61% -69% -99% jmac 8.42/s 855% 567% 322% 204% 159% -- -19% -97% lanX 10.4/s 1076% 721% 420% 274% 219% 23% -- -97% fletch 309/s 34974% 24395% 15418% 11055% 9407% 3575% 2883% --
I suspect that constantly reallocating the results string every 8 insertions does for them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Interleaving bytes in a string quickly
by ikegami (Patriarch) on Feb 26, 2010 at 18:36 UTC | |
by BrowserUk (Patriarch) on Feb 26, 2010 at 20:19 UTC |