NAME

Bencher::Scenario::IPManipulation::ValidateIPv4 - Benchmark validation of IPv4 address string

VERSION

This document describes version 0.002 of Bencher::Scenario::IPManipulation::ValidateIPv4 (from Perl distribution Bencher-Scenarios-IPManipulation), released on 2017-01-25.

SYNOPSIS

To run benchmark with default option:

 % bencher -m IPManipulation::ValidateIPv4

To run module startup overhead benchmark:

 % bencher --module-startup -m IPManipulation::ValidateIPv4

For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see bencher or run bencher --help.

DESCRIPTION

Packaging a benchmark script as a Bencher scenario makes it convenient to include/exclude/add participants/datasets (either via CLI or Perl code), send the result to a central repository, among others . See Bencher and bencher (CLI) for more details.

BENCHMARKED MODULES

Version numbers shown below are the versions used when running the sample benchmark.

NetAddr::IP 4.079

NetObj::IPv4Address 1.0

Net::CIDR 0.18

BENCHMARK PARTICIPANTS

  • NetAddr::IP (perl_code)

    Code template:

     NetAddr::IP->new(<str>) ? 1:0
  • NetObj::IPv4Address (perl_code)

    Code template:

     NetObj::IPv4Address::is_valid(<str>)
  • Net::CIDR (perl_code)

    Code template:

     Net::CIDR::cidrvalidate(<str>) ? 1:0

BENCHMARK DATASETS

  • x

  • 300.0.0.0

  • 127.0.0.2

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.24.0, CPU: Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz (2 cores), OS: GNU/Linux LinuxMint version 17.3, OS kernel: Linux version 3.19.0-32-generic.

Benchmark with default options (bencher -m IPManipulation::ValidateIPv4):

 #table1#
 {dataset=>"127.0.0.2"}
 +---------------------+-----------+-----------+------------+---------+---------+
 | participant         | rate (/s) | time (μs) | vs_slowest |  errors | samples |
 +---------------------+-----------+-----------+------------+---------+---------+
 | Net::CIDR           |     16000 |     63    |        1   |   1e-07 |      21 |
 | NetAddr::IP         |     42000 |     24    |        2.6 | 2.5e-08 |      22 |
 | NetObj::IPv4Address |    331000 |      3.02 |       20.9 | 7.9e-10 |      22 |
 +---------------------+-----------+-----------+------------+---------+---------+

 #table2#
 {dataset=>"300.0.0.0"}
 +---------------------+-----------+-----------+------------+---------+---------+
 | participant         | rate (/s) | time (μs) | vs_slowest |  errors | samples |
 +---------------------+-----------+-----------+------------+---------+---------+
 | NetAddr::IP         |    160000 |       6.4 |        1   | 1.5e-08 |      20 |
 | NetObj::IPv4Address |    520000 |       1.9 |        3.3 | 3.3e-09 |      20 |
 | Net::CIDR           |    550000 |       1.8 |        3.5 | 3.3e-09 |      20 |
 +---------------------+-----------+-----------+------------+---------+---------+

 #table3#
 {dataset=>"x"}
 +---------------------+-----------+-----------+------------+---------+---------+
 | participant         | rate (/s) | time (ms) | vs_slowest |  errors | samples |
 +---------------------+-----------+-----------+------------+---------+---------+
 | NetAddr::IP         |       280 |   3.5     |          1 | 1.6e-05 |      20 |
 | NetObj::IPv4Address |    913000 |   0.0011  |       3230 | 4.2e-10 |      20 |
 | Net::CIDR           |   1850000 |   0.00054 |       6540 | 1.7e-10 |      30 |
 +---------------------+-----------+-----------+------------+---------+---------+

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

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Bencher-Scenarios-IPManipulation.

SOURCE

Source repository is at https://github.com/perlancar/perl-Bencher-Scenarios-IPManipulation.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Bencher-Scenarios-IPManipulation

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.