NAME

Acme::CPANModules::TextTable - Modules that generate text tables

VERSION

This document describes version 0.002 of Acme::CPANModules::TextTable (from Perl distribution Acme-CPANModules-TextTable), released on 2019-02-24.

SYNOPSIS

To run benchmark with default option:

% bencher --cpanmodules-module TextTable

To run module startup overhead benchmark:

% bencher --module-startup --cpanmodules-module TextTable

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

DESCRIPTION

Modules that generate text tables.

BENCHMARKED MODULES

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

Text::ANSITable 0.501

Text::ASCIITable 0.20

Text::FormatTable 1.03

Text::MarkdownTable 0.3.1

Text::Table 1.131

Text::Table::Tiny 0.04

Text::Table::TinyColor 0.002

Text::Table::TinyColorWide 0.001

Text::Table::TinyWide 0.001

Text::Table::Org 0.02

Text::Table::CSV 0.021

Text::Table::HTML 0.003

Text::Table::HTML::DataTables 0.002

Text::TabularDisplay 1.38

BENCHMARK PARTICIPANTS

BENCHMARK DATASETS

  • tiny (1x1)

  • small (3x5)

  • wide (30x5)

  • long (3x300)

  • large (30x300)

SAMPLE BENCHMARK RESULTS

Run on: perl: v5.24.0, CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4 cores), OS: GNU/Linux LinuxMint version 18.2, OS kernel: Linux version 4.8.0-53-generic.

Benchmark with default options (bencher --cpanmodules-module TextTable):

#table1#
{dataset=>"large (30x300)"}
+-------------------------------+-----------+-----------+------------+-----------+---------+
| participant                   | rate (/s) | time (ms) | vs_slowest |  errors   | samples |
+-------------------------------+-----------+-----------+------------+-----------+---------+
| Text::ANSITable               |       3.3 |     300   |        1   |   0.0007  |      20 |
| Text::ASCIITable              |       7.8 |     130   |        2.4 |   0.00023 |      20 |
| Text::Table::TinyColorWide    |      18   |      56   |        5.4 |   0.00024 |      21 |
| Text::FormatTable             |      21   |      48   |        6.3 | 9.3e-05   |      20 |
| Text::Table::TinyWide         |      25   |      40   |        7.6 | 8.7e-05   |      20 |
| Text::TabularDisplay          |      50   |      20   |       15   | 7.8e-05   |      20 |
| Text::Table::TinyColor        |      65   |      15   |       20   | 2.9e-05   |      20 |
| Text::MarkdownTable           |     100   |       9.8 |       31   | 4.7e-05   |      20 |
| Text::Table                   |     130   |       7.8 |       39   | 5.8e-05   |      20 |
| Text::Table::HTML::DataTables |     140   |       7.1 |       42   | 1.6e-05   |      20 |
| Text::Table::HTML             |     140   |       7.1 |       42   | 3.7e-05   |      20 |
| Text::Table::CSV              |     250   |       4   |       76   | 1.5e-05   |      20 |
| Text::Table::Org              |     260   |       3.8 |       79   | 2.6e-05   |      22 |
| Text::Table::Tiny             |     320   |       3.1 |       96   | 1.2e-05   |      20 |
+-------------------------------+-----------+-----------+------------+-----------+---------+

#table2#
{dataset=>"long (3x300)"}
+-------------------------------+-----------+-----------+------------+-----------+---------+
| participant                   | rate (/s) | time (ms) | vs_slowest |  errors   | samples |
+-------------------------------+-----------+-----------+------------+-----------+---------+
| Text::ANSITable               |        29 |    34     |        1   |   0.00014 |      20 |
| Text::ASCIITable              |        81 |    12     |        2.8 | 3.3e-05   |      21 |
| Text::Table::TinyColorWide    |       180 |     5.7   |        5.9 | 3.8e-05   |      22 |
| Text::FormatTable             |       190 |     5.4   |        6.3 | 2.5e-05   |      20 |
| Text::Table::TinyWide         |       230 |     4.3   |        7.9 | 6.5e-06   |      20 |
| Text::TabularDisplay          |       370 |     2.7   |       13   | 9.8e-06   |      20 |
| Text::MarkdownTable           |       490 |     2     |       17   | 1.8e-05   |      20 |
| Text::Table                   |       600 |     2     |       20   | 2.5e-05   |      20 |
| Text::Table::TinyColor        |       650 |     1.5   |       22   | 8.5e-06   |      20 |
| Text::Table::HTML             |      1000 |     0.8   |       40   | 8.5e-06   |      20 |
| Text::Table::HTML::DataTables |      1200 |     0.83  |       41   | 8.8e-07   |      21 |
| Text::Table::Org              |      1900 |     0.51  |       66   | 6.8e-07   |      21 |
| Text::Table::CSV              |      2000 |     0.501 |       67.7 | 2.7e-07   |      20 |
| Text::Table::Tiny             |      2400 |     0.417 |       81.4 | 2.1e-07   |      20 |
+-------------------------------+-----------+-----------+------------+-----------+---------+

#table3#
{dataset=>"small (3x5)"}
+-------------------------------+-----------+-----------+------------+---------+---------+
| participant                   | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+-------------------------------+-----------+-----------+------------+---------+---------+
| Text::ANSITable               |    1200   |  830      |     1      | 4.4e-06 |      20 |
| Text::ASCIITable              |    3440   |  291      |     2.87   | 2.1e-07 |      20 |
| Text::Table::TinyColorWide    |    8100   |  120      |     6.7    | 4.3e-07 |      20 |
| Text::FormatTable             |    8200   |  120      |     6.8    | 2.1e-07 |      20 |
| Text::Table                   |    8800   |  110      |     7.4    | 2.1e-07 |      20 |
| Text::Table::TinyWide         |   11700   |   85.2    |     9.78   | 2.7e-08 |      20 |
| Text::MarkdownTable           |   15000   |   67      |    12      | 1.3e-07 |      20 |
| Text::TabularDisplay          |   17000   |   59      |    14      | 7.5e-08 |      23 |
| Text::Table::HTML::DataTables |   26000   |   39      |    21      | 5.2e-08 |      21 |
| Text::Table::TinyColor        |   27000   |   38      |    22      | 1.7e-07 |      20 |
| Text::Table::HTML             |   54700   |   18.3    |    45.6    | 6.4e-09 |      22 |
| Text::Table::Org              |   60000   |   17      |    50      | 2.4e-08 |      24 |
| Text::Table::Tiny             |   64895.4 |   15.4094 |    54.1096 | 5.8e-12 |      22 |
| Text::Table::CSV              |   89036.3 |   11.2314 |    74.2382 | 5.8e-12 |      20 |
+-------------------------------+-----------+-----------+------------+---------+---------+

#table4#
{dataset=>"tiny (1x1)"}
+-------------------------------+-----------+-----------+------------+---------+---------+
| participant                   | rate (/s) | time (μs) | vs_slowest |  errors | samples |
+-------------------------------+-----------+-----------+------------+---------+---------+
| Text::ANSITable               |      4600 |     220   |        1   | 6.4e-07 |      20 |
| Text::ASCIITable              |     13000 |      77   |        2.8 | 1.2e-07 |      24 |
| Text::Table                   |     22000 |      45   |        4.9 | 3.3e-07 |      20 |
| Text::MarkdownTable           |     28000 |      36   |        6.1 | 2.7e-07 |      21 |
| Text::FormatTable             |     38000 |      26   |        8.4 | 5.3e-08 |      20 |
| Text::Table::HTML::DataTables |     42000 |      24   |        9.2 | 3.2e-08 |      22 |
| Text::Table::TinyColorWide    |     48000 |      21   |       11   | 2.7e-08 |      20 |
| Text::Table::TinyWide         |     64000 |      16   |       14   | 2.7e-08 |      20 |
| Text::TabularDisplay          |     68000 |      15   |       15   | 2.7e-08 |      20 |
| Text::Table::TinyColor        |    110000 |       9.5 |       23   |   1e-08 |      20 |
| Text::Table::Tiny             |    150000 |       6.5 |       34   |   1e-08 |      20 |
| Text::Table::Org              |    200000 |       6   |       40   | 6.3e-08 |      20 |
| Text::Table::HTML             |    200000 |       4.9 |       45   | 1.3e-08 |      20 |
| Text::Table::CSV              |    340000 |       3   |       74   | 6.7e-09 |      20 |
+-------------------------------+-----------+-----------+------------+---------+---------+

#table5#
{dataset=>"wide (30x5)"}
+-------------------------------+-----------+-----------+------------+---------+---------+
| participant                   | rate (/s) | time (ms) | vs_slowest |  errors | samples |
+-------------------------------+-----------+-----------+------------+---------+---------+
| Text::ANSITable               |       150 |     6.7   |        1   | 2.9e-05 |      20 |
| Text::ASCIITable              |       370 |     2.7   |        2.5 |   2e-05 |      20 |
| Text::FormatTable             |       830 |     1.2   |        5.6 | 6.9e-06 |      20 |
| Text::Table::TinyColorWide    |       920 |     1.1   |        6.2 | 4.5e-06 |      20 |
| Text::Table::TinyWide         |      1200 |     0.83  |        8.1 |   4e-06 |      20 |
| Text::Table                   |      1300 |     0.76  |        8.8 | 5.6e-06 |      20 |
| Text::TabularDisplay          |      2400 |     0.41  |       16   | 1.2e-06 |      20 |
| Text::Table::TinyColor        |      3400 |     0.3   |       23   | 1.6e-06 |      20 |
| Text::MarkdownTable           |      4200 |     0.24  |       28   | 4.3e-07 |      20 |
| Text::Table::HTML::DataTables |      6000 |     0.17  |       40   |   1e-06 |      21 |
| Text::Table::HTML             |      7500 |     0.133 |       50.3 | 5.3e-08 |      20 |
| Text::Table::Org              |     10000 |     0.096 |       70   | 1.1e-07 |      20 |
| Text::Table::Tiny             |     11000 |     0.089 |       76   | 5.6e-07 |      20 |
| Text::Table::CSV              |     13500 |     0.074 |       90.6 | 2.7e-08 |      20 |
+-------------------------------+-----------+-----------+------------+---------+---------+

Benchmark module startup overhead (bencher --cpanmodules-module TextTable --module-startup):

#table6#
+-------------------------------+-----------+------------------------+------------+-----------+---------+
| participant                   | time (ms) | mod_overhead_time (ms) | vs_slowest |  errors   | samples |
+-------------------------------+-----------+------------------------+------------+-----------+---------+
| Text::ANSITable               |      40   |                   36   |        1   |   0.00021 |      20 |
| Text::MarkdownTable           |      32   |                   28   |        1.2 |   0.00021 |      20 |
| Text::Table::TinyColorWide    |      31   |                   27   |        1.3 |   0.00011 |      20 |
| Text::Table::TinyWide         |      30   |                   26   |        1.3 |   0.00016 |      21 |
| Text::ASCIITable              |      20   |                   16   |        2   |   0.00017 |      20 |
| Text::Table                   |      16   |                   12   |        2.5 | 7.3e-05   |      20 |
| Text::FormatTable             |      11   |                    7   |        3.8 | 7.5e-05   |      20 |
| Text::Table::TinyColor        |       9.7 |                    5.7 |        4.1 | 7.8e-05   |      20 |
| Text::Table::Tiny             |       8   |                    4   |        5   |   0.00013 |      20 |
| Text::TabularDisplay          |       8   |                    4   |        5   |   0.00011 |      20 |
| Text::Table::HTML             |       8   |                    4   |        5   |   0.00015 |      20 |
| Text::Table::HTML::DataTables |       7   |                    3   |        5   |   0.00015 |      20 |
| Text::Table::CSV              |       6   |                    2   |        7   |   0.00012 |      20 |
| Text::Table::Org              |       5   |                    1   |        7   |   0.00013 |      20 |
| perl -e1 (baseline)           |       4   |                    0   |       10   | 3.9e-05   |      20 |
+-------------------------------+-----------+------------------------+------------+-----------+---------+

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

INCLUDED MODULES

FEATURE COMPARISON MATRIX

+-------------------------------+--------------+-----------+---------------+
| module                        | box_char *1) | color *2) | wide_char *3) |
+-------------------------------+--------------+-----------+---------------+
| Text::ANSITable               | yes          | yes       | yes           |
| Text::ASCIITable              | no           | no        | no            |
| Text::FormatTable             | no           | no        | no            |
| Text::MarkdownTable           | no           | no        | no            |
| Text::Table                   | N/A *4)      | no        | no            |
| Text::Table::Tiny             | no           | no        | no            |
| Text::Table::TinyColor        | no           | yes       | no            |
| Text::Table::TinyColorWide    | no           | yes       | yes           |
| Text::Table::TinyWide         | no           | no        | yes           |
| Text::Table::Org              | no           | no        | no            |
| Text::Table::CSV              | N/A *5)      | no        | yes           |
| Text::Table::HTML             | N/A          | N/A       | N/A           |
| Text::Table::HTML::DataTables | N/A          | N/A       | N/A           |
| Text::TabularDisplay          | N/A *6)      | no        | yes           |
+-------------------------------+--------------+-----------+---------------+

Notes:

1. box_char: Whether the module can utilize box-drawing characters
2. color: Whether the module supports ANSI colors
3. wide_char: Whether the use of wide characters (e.g. Kanji) in cells does not cause the table to be misaligned
4. Does not draw borders
5. Irrelevant
6. Irrelevant

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Acme-CPANModules-TextTable.

SOURCE

Source repository is at https://github.com/perlancar/perl-Acme-CPANModules-TextTable.

BUGS

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

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

Acme::CPANModules - about the Acme::CPANModules namespace

cpanmodules - CLI tool to let you browse/view the lists

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 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.