Acme-CPANModules-UUID

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/UUID.pm  view on Meta::CPAN

 UUID::Random::PERLANCAR::generate() for 1..1000; UUID::Random::PERLANCAR::generate()



=item * UUID::Random::PERLANCAR::generate_rfc (perl_code)

Code template:

 UUID::Random::PERLANCAR::generate_rfc() for 1..1000; UUID::Random::PERLANCAR::generate_rfc()



=item * UUID::Random::Secure::generate (perl_code)

Code template:

 UUID::Random::Secure::generate() for 1..1000; UUID::Random::Secure::generate()



=item * UUID::Random::Secure::generate_rfc (perl_code)

Code template:

 UUID::Random::Secure::generate_rfc() for 1..1000; UUID::Random::Secure::generate_rfc()



=item * Crypt::Misc (perl_code)

Code template:

 Crypt::Misc::random_v4uuid() for 1..1000; Crypt::Misc::random_v4uuid()



=item * UUID (perl_code)

Code template:

 my $uuid; UUID::generate_random($uuid) for 1..1000; UUID::generate_random($uuid); $uuid



=back

=head1 BENCHMARK SAMPLE RESULTS

=head2 Sample benchmark #1

Run on: perl: I<< v5.38.0 >>, CPU: I<< Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (2 cores) >>, OS: I<< GNU/Linux Ubuntu version 20.04 >>, OS kernel: I<< Linux version 5.4.0-164-generic >>.

Benchmark command (default options):

 % bencher --cpanmodules-module UUID

Result formatted as table:

 #table1#
 +---------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                           | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +---------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | UUID::Random::Secure::generate        |        30 |     30    |                 0.00% |              4218.76% |   0.0013  |      22 |
 | UUID::Random::Secure::generate_rfc    |        40 |     20    |                42.61% |              2928.29% |   0.0003  |      21 |
 | UUID::Random                          |       100 |      9    |               257.90% |              1106.70% |   0.00018 |      20 |
 | UUID::Tiny                            |       100 |      8    |               335.56% |               891.54% |   0.00013 |      20 |
 | UUID                                  |       171 |      5.84 |               481.07% |               643.25% | 1.4e-06   |      21 |
 | Crypt::Misc                           |       296 |      3.37 |               906.43% |               329.12% | 2.6e-06   |      20 |
 | UUID::Random::PERLANCAR::generate_rfc |       520 |      1.9  |              1682.35% |               142.31% | 7.6e-06   |      20 |
 | UUID::Random::PERLANCAR::generate     |       900 |      1    |              2809.14% |                48.45% | 2.5e-05   |      23 |
 | UUID::FFI                             |       870 |      1.2  |              2848.45% |                46.48% | 1.8e-06   |      20 |
 | Data::UUID                            |      1000 |      0.8  |              4218.76% |                 0.00% | 9.3e-06   |      21 |
 +---------------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+


The above result formatted in L<Benchmark.pm|Benchmark> style:

             Rate  URS:g  URS:g_r    U:R   U:T     U   C:M  URP:g_r   U:F  URP:g   D:U 
  URS:g      30/s     --     -33%   -70%  -73%  -80%  -88%     -93%  -96%   -96%  -97% 
  URS:g_r    40/s    50%       --   -55%  -60%  -70%  -83%     -90%  -94%   -95%  -96% 
  U:R       100/s   233%     122%     --  -11%  -35%  -62%     -78%  -86%   -88%  -91% 
  U:T       100/s   275%     150%    12%    --  -27%  -57%     -76%  -85%   -87%  -90% 
  U         171/s   413%     242%    54%   36%    --  -42%     -67%  -79%   -82%  -86% 
  C:M       296/s   790%     493%   167%  137%   73%    --     -43%  -64%   -70%  -76% 
  URP:g_r   520/s  1478%     952%   373%  321%  207%   77%       --  -36%   -47%  -57% 
  U:F       870/s  2400%    1566%   650%  566%  386%  180%      58%    --   -16%  -33% 
  URP:g     900/s  2900%    1900%   800%  700%  484%  237%      89%   19%     --  -19% 
  D:U      1000/s  3650%    2400%  1025%  900%  630%  321%     137%   49%    25%    -- 
 
 Legends:
   C:M: participant=Crypt::Misc
   D:U: participant=Data::UUID
   U: participant=UUID
   U:F: participant=UUID::FFI
   U:R: participant=UUID::Random
   U:T: participant=UUID::Tiny
   URP:g: participant=UUID::Random::PERLANCAR::generate
   URP:g_r: participant=UUID::Random::PERLANCAR::generate_rfc
   URS:g: participant=UUID::Random::Secure::generate
   URS:g_r: participant=UUID::Random::Secure::generate_rfc

=head2 Sample benchmark #2

Benchmark command (benchmarking module startup overhead):

 % bencher --cpanmodules-module UUID --module-startup

Result formatted as table:

 #table2#
 +-------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+
 | participant             | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +-------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+
 | UUID::Random::Secure    |     95    |             88.45 |                 0.00% |              1352.22% |   0.00022 |      20 |
 | UUID::FFI               |     53    |             46.45 |                80.85% |               703.01% |   0.00013 |      20 |
 | UUID::Tiny              |     26.7  |             20.15 |               256.48% |               307.38% | 2.3e-05   |      20 |
 | Crypt::Misc             |     20.9  |             14.35 |               354.68% |               219.40% | 1.9e-05   |      20 |
 | Data::UUID              |     20    |             13.45 |               429.95% |               174.03% |   0.00041 |      20 |
 | UUID                    |     11.4  |              4.85 |               734.65% |                73.99% | 5.5e-06   |      20 |
 | UUID::Random            |      8.9  |              2.35 |               962.94% |                36.62% |   1e-05   |      20 |
 | UUID::Random::PERLANCAR |      8.94 |              2.39 |               964.20% |                36.46% | 7.2e-06   |      20 |
 | perl -e1 (baseline)     |      6.55 |              0    |              1352.22% |                 0.00% | 6.3e-06   |      20 |
 +-------------------------+-----------+-------------------+-----------------------+-----------------------+-----------+---------+


The above result formatted in L<Benchmark.pm|Benchmark> style:

                          Rate   UR:S   U:F   U:T   C:M   D:U     U  UR:P   U:R  perl -e1 (baseline) 
  UR:S                  10.5/s     --  -44%  -71%  -78%  -78%  -88%  -90%  -90%                 -93% 
  U:F                   18.9/s    79%    --  -49%  -60%  -62%  -78%  -83%  -83%                 -87% 
  U:T                   37.5/s   255%   98%    --  -21%  -25%  -57%  -66%  -66%                 -75% 
  C:M                   47.8/s   354%  153%   27%    --   -4%  -45%  -57%  -57%                 -68% 
  D:U                   50.0/s   375%  165%   33%    4%    --  -42%  -55%  -55%                 -67% 
  U                     87.7/s   733%  364%  134%   83%   75%    --  -21%  -21%                 -42% 
  UR:P                 111.9/s   962%  492%  198%  133%  123%   27%    --    0%                 -26% 
  U:R                  112.4/s   967%  495%  200%  134%  124%   28%    0%    --                 -26% 
  perl -e1 (baseline)  152.7/s  1350%  709%  307%  219%  205%   74%   36%   35%                   -- 
 
 Legends:
   C:M: mod_overhead_time=14.35 participant=Crypt::Misc
   D:U: mod_overhead_time=13.45 participant=Data::UUID
   U: mod_overhead_time=4.85 participant=UUID
   U:F: mod_overhead_time=46.45 participant=UUID::FFI
   U:R: mod_overhead_time=2.35 participant=UUID::Random
   U:T: mod_overhead_time=20.15 participant=UUID::Tiny
   UR:P: mod_overhead_time=2.39 participant=UUID::Random::PERLANCAR
   UR:S: mod_overhead_time=88.45 participant=UUID::Random::Secure
   perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)

To display as an interactive HTML table on a browser, you can add option C<--format html+datatables>.

=head1 FAQ

=head2 What is an Acme::CPANModules::* module?

An Acme::CPANModules::* module, like this module, contains just a list of module
names that share a common characteristics. It is a way to categorize modules and
document CPAN. See L<Acme::CPANModules> for more details.

=head2 What are ways to use this Acme::CPANModules module?

Aside from reading this Acme::CPANModules module's POD documentation, you can
install all the listed modules (entries) using L<cpanm-cpanmodules> script (from
L<App::cpanm::cpanmodules> distribution):

 % cpanm-cpanmodules -n UUID

Alternatively you can use the L<cpanmodules> CLI (from L<App::cpanmodules>
distribution):

    % cpanmodules ls-entries UUID | cpanm -n



( run in 1.340 second using v1.01-cache-2.11-cpan-39bf76dae61 )