"Fossies" - the Fresh Open Source Software Archive

Member "MIME-Base64-3.16/benchmark" (27 Sep 2020, 374 Bytes) of package /linux/privat/MIME-Base64-3.16.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use blib;
    2 
    3 use Benchmark;
    4 use MIME::Base64;
    5 
    6 $str = "x" x 10000;
    7 
    8 timethese(3000, {
    9    'XS Encode'  => sub { encode_base64($str) },
   10    'Old encode' => sub { MIME::Base64::old_encode_base64($str) },
   11 });
   12 
   13 $str = encode_base64("x" x 1000);
   14 
   15 timethese(8000, {
   16    'XS Decode'  => sub { decode_base64($str) },
   17    'Old decode' => sub { MIME::Base64::old_decode_base64($str) },
   18 });