Acme-CPANModules-TextTable

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.009   2021-02-20  Released-By: PERLANCAR; Urgency: medium

	- Add features: column_width, per_column_width, row_height,
	  per_row_height, pad, vpad.

	- Add entries: Text::Table::Any, Text::Table::More,
          Text::Table::Manifold, Text::UnicodeBox::Table.

	- [doc] Mention Acme::CPANModules::HTMLTable.

	- Add datasets that contain color & wide char.


0.008   2021-02-15  Released-By: PERLANCAR; Urgency: medium

	- Rename feature: color -> color_data.

        - Add features: custom_border, custom_color, color_theme, align_cell,
	  align_column, rowspan, colspan.

	- Add participants: Text::Table::TinyBorderStyle,
	  Text::Table::Span.


0.007   2021-01-31  Released-By: PERLANCAR; Urgency: high

        - Merge releases 0.006 & 0.006.1.


0.006.1  2021-01-25  Released-By: PERLANCAR; Urgency: medium; Cancelled: yes

	- Add feature: multiline_data.

        - UPDATE 2021-01-31: rename version from 0.006 to 0.006.1 to avoid
          conflict.


0.006   2020-09-13  Released-By: PERLANCAR; Urgency: medium

	- Note that Text::Table::Tiny (1.01_01) can now handle wide
	  characters.

META.json  view on Meta::CPAN

            "version" : "0.10"
         },
         {
            "class" : "Dist::Zilla::Plugin::PodnameFromFilename",
            "name" : "@Author::PERLANCAR/PodnameFromFilename",
            "version" : "0.02"
         },
         {
            "class" : "Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec",
            "config" : {
               "Dist::Zilla::Role::ModuleMetadata" : {
                  "Module::Metadata" : "1.000037",
                  "version" : "0.006"
               }
            },
            "name" : "@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec",
            "version" : "0.064"
         },
         {
            "class" : "Dist::Zilla::Plugin::PERLANCAR::MetaResources",
            "name" : "@Author::PERLANCAR/PERLANCAR::MetaResources",
            "version" : "0.043"

META.json  view on Meta::CPAN

            "version" : "0.001"
         },
         {
            "class" : "Dist::Zilla::Plugin::CheckSelfDependency",
            "config" : {
               "Dist::Zilla::Plugin::CheckSelfDependency" : {
                  "finder" : [
                     ":InstallModules"
                  ]
               },
               "Dist::Zilla::Role::ModuleMetadata" : {
                  "Module::Metadata" : "1.000037",
                  "version" : "0.006"
               }
            },
            "name" : "@Author::PERLANCAR/CheckSelfDependency",
            "version" : "0.011"
         },
         {
            "class" : "Dist::Zilla::Plugin::Git::Contributors",
            "config" : {
               "Dist::Zilla::Plugin::Git::Contributors" : {

META.json  view on Meta::CPAN

                     }
                  ],
                  "include_underscores" : 0
               },
               "Dist::Zilla::Role::MetaProvider::Provider" : {
                  "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004",
                  "inherit_missing" : 1,
                  "inherit_version" : 1,
                  "meta_noindex" : 1
               },
               "Dist::Zilla::Role::ModuleMetadata" : {
                  "Module::Metadata" : "1.000037",
                  "version" : "0.006"
               }
            },
            "name" : "@Author::PERLANCAR/MetaProvides::Package",
            "version" : "2.004003"
         },
         {
            "class" : "Dist::Zilla::Plugin::PERLANCAR::Authority",
            "name" : "@Author::PERLANCAR/PERLANCAR::Authority",
            "version" : "0.001"

META.yml  view on Meta::CPAN

      class: Dist::Zilla::Plugin::Rinci::AbstractFromMeta
      name: '@Author::PERLANCAR/Rinci::AbstractFromMeta'
      version: '0.10'
    -
      class: Dist::Zilla::Plugin::PodnameFromFilename
      name: '@Author::PERLANCAR/PodnameFromFilename'
      version: '0.02'
    -
      class: Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec
      config:
        Dist::Zilla::Role::ModuleMetadata:
          Module::Metadata: '1.000037'
          version: '0.006'
      name: '@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec'
      version: '0.064'
    -
      class: Dist::Zilla::Plugin::PERLANCAR::MetaResources
      name: '@Author::PERLANCAR/PERLANCAR::MetaResources'
      version: '0.043'
    -
      class: Dist::Zilla::Plugin::CheckChangeLog
      name: '@Author::PERLANCAR/CheckChangeLog'

META.yml  view on Meta::CPAN

    -
      class: Dist::Zilla::Plugin::CheckMetaResources
      name: '@Author::PERLANCAR/CheckMetaResources'
      version: '0.001'
    -
      class: Dist::Zilla::Plugin::CheckSelfDependency
      config:
        Dist::Zilla::Plugin::CheckSelfDependency:
          finder:
            - ':InstallModules'
        Dist::Zilla::Role::ModuleMetadata:
          Module::Metadata: '1.000037'
          version: '0.006'
      name: '@Author::PERLANCAR/CheckSelfDependency'
      version: '0.011'
    -
      class: Dist::Zilla::Plugin::Git::Contributors
      config:
        Dist::Zilla::Plugin::Git::Contributors:
          git_version: 2.25.1
          include_authors: 0
          include_releaser: 1

META.yml  view on Meta::CPAN

            -
              class: Dist::Zilla::Plugin::FinderCode
              name: '@Author::PERLANCAR/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
              version: '6.030'
          include_underscores: 0
        Dist::Zilla::Role::MetaProvider::Provider:
          $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004'
          inherit_missing: 1
          inherit_version: 1
          meta_noindex: 1
        Dist::Zilla::Role::ModuleMetadata:
          Module::Metadata: '1.000037'
          version: '0.006'
      name: '@Author::PERLANCAR/MetaProvides::Package'
      version: '2.004003'
    -
      class: Dist::Zilla::Plugin::PERLANCAR::Authority
      name: '@Author::PERLANCAR/PERLANCAR::Authority'
      version: '0.001'
    -
      class: Dist::Zilla::Plugin::OurDate
      name: '@Author::PERLANCAR/OurDate'

README  view on Meta::CPAN

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
    Currently excluded from this list are:

    *   Text::SimpleTable::AutoWidth (wrapper to Text::SimpleTable);

    *   Text::ASCIITable::EasyTable (wrapper to Text::ASCIITable);

ACME::CPANMODULES ENTRIES

README  view on Meta::CPAN

        Author: PERLANCAR <https://metacpan.org/author/PERLANCAR>

    Text::Table::HTML::DataTables
        Author: PERLANCAR <https://metacpan.org/author/PERLANCAR>

    Text::TabularDisplay
        Author: DARREN <https://metacpan.org/author/DARREN>

ACME::CPANMODULES FEATURE COMPARISON MATRIX
     +-------------------------------+----------------+------------------+---------------+--------------+----------------+-----------------+-------------+-------------------+------------------+---------------------+--------------+------------+-------...
     | module                        | align_cell *1) | align_column *2) | align_row *3) | box_char *4) | color_data *5) | color_theme *6) | colspan *7) | custom_border *8) | custom_color *9) | multiline_data *10) | rowspan *11) | speed *12) | valign...
     +-------------------------------+----------------+------------------+---------------+--------------+----------------+-----------------+-------------+-------------------+------------------+---------------------+--------------+------------+-------...
     | Text::Table::Any              | N/A *22)       | N/A *22)         | N/A *22)      | N/A *22)     | N/A *22)       | N/A *22)        | N/A *22)    | N/A *22)          | N/A *22)         | N/A *22)            | N/A *22)     | N/A *22)   | N/A *2...
     | Text::SimpleTable             | no             | no               | no            | no           | no             | no              | no          | yes *23)          | no               | no                  | no           | fast *24)  | no    ...
     | Text::UnicodeBox::Table       | no             | yes              | N/A           | no           | yes            | no              | no          | yes               | no               | no                  | no           | slow       | N/A   ...
     | Text::Table::Manifold         | no             | yes              | N/A           | N/A          | yes            | no              | no          | no *25)           | no               | no                  | no           | N/A        | N/A   ...
     | Text::ANSITable               | yes            | yes              | yes           | yes          | yes            | yes             | no          | yes               | yes              | yes                 | no           | slow       | yes   ...
     | Text::ASCIITable              | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A   ...
     | Text::FormatTable             | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A   ...
     | Text::MarkdownTable           | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | no *26)             | N/A          | N/A        | N/A   ...
     | Text::Table                   | N/A            | N/A              | N/A           | N/A *27)     | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A   ...

README  view on Meta::CPAN


    Notes:

    1. align_cell: Whether module supports aligning text horizontally in
    individual cells (left/right/middle)
    2. align_column: Whether module supports aligning text horizontally in a
    column (left/right/middle)
    3. align_row: Whether module supports aligning text horizontally in a
    row (left/right/middle)
    4. box_char: Whether module can utilize box-drawing characters
    5. color_data: Whether module supports ANSI colors (i.e. text with ANSI
    color codes can still be aligned properly)
    6. color_theme: Whether the module supports color theme/scheme
    7. colspan: Whether module supports column spans
    8. custom_border: Whether module allows customizing border in some way
    9. custom_color: Whether the module produces colored table and supports
    customizing color in some way
    10. multiline_data: Whether module supports aligning data cells that
    contain newlines
    11. rowspan: Whether module supports row spans
    12. speed: Rendering speed
    13. valign_cell: Whether module supports aligning text vertically in
    individual cells (top/bottom/middle)
    14. valign_column: Whether module supports aligning text vertically in a
    column (top/bottom/middle)
    15. valign_row: Whether module supports aligning text vertically in a
    row (top/bottom/middle)
    16. column_width: Whether module allows setting the width of columns

README  view on Meta::CPAN

    *   tiny (1x1)

    *   small (3x5)

    *   wide (30x5)

    *   long (3x300)

    *   large (30x300)

    *   multiline data (2x1) (not included by default)

    *   wide char data (1x2) (not included by default)

    *   color data (1x2) (not included by default)

BENCHMARK SAMPLE RESULTS
  Sample benchmark #1
    Run on: perl: *v5.38.0*, CPU: *Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    (2 cores)*, OS: *GNU/Linux Ubuntu version 20.04*, OS kernel: *Linux
    version 5.4.0-164-generic*.

    Benchmark command (default options):

     % bencher --cpanmodules-module TextTable

    Result formatted as table (split, part 1 of 5):

     #table1#
     {dataset=>"large (30x300)"}
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | Text::UnicodeBox::Table       |      0.92 |    1100   |                 0.00% |             35566.44% |   0.0024  |      20 |
     | Text::ANSITable               |      1.8  |     560   |                94.68% |             18220.90% |   0.0012  |      20 |
     | Text::Table::More             |      2.5  |     400   |               167.94% |             13211.33% |   0.00094 |      20 |
     | Text::ASCIITable              |      9.6  |     100   |               934.43% |              3347.94% |   0.00076 |      20 |
     | Text::Table::TinyColorWide    |     10    |      70   |              1365.67% |              2333.45% |   0.0008  |      20 |
     | Text::FormatTable             |     15    |      69   |              1474.71% |              2164.95% |   0.00063 |      20 |
     | Text::Table::TinyWide         |     20    |      50   |              1927.24% |              1659.36% |   0.00058 |      20 |

README  view on Meta::CPAN

       Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
       Text::Table::TinyWide: participant=Text::Table::TinyWide
       Text::TabularDisplay: participant=Text::TabularDisplay
       Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

    The above result presented as chart:

    Result formatted as table (split, part 2 of 5):

     #table2#
     {dataset=>"long (3x300)"}
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | Text::UnicodeBox::Table       |       7.4 |   140     |                 0.00% |             35069.88% |   0.0005  |      20 |
     | Text::ANSITable               |      17   |    58     |               132.94% |             14998.05% |   0.00043 |      21 |
     | Text::Table::More             |      21   |    49     |               178.85% |             12512.60% |   0.00046 |      20 |
     | Text::ASCIITable              |     100   |    10     |              1223.05% |              2558.25% |   0.00022 |      22 |
     | Text::FormatTable             |     100   |     8     |              1644.13% |              1916.47% |   0.00026 |      21 |
     | Text::Table::TinyColorWide    |     100   |     7     |              1789.53% |              1761.30% |   0.00016 |      20 |
     | Text::Table::TinyWide         |     200   |     5     |              2638.44% |              1184.31% | 6.1e-05   |      20 |

README  view on Meta::CPAN

       Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
       Text::Table::TinyWide: participant=Text::Table::TinyWide
       Text::TabularDisplay: participant=Text::TabularDisplay
       Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

    The above result presented as chart:

    Result formatted as table (split, part 3 of 5):

     #table3#
     {dataset=>"small (3x5)"}
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | Text::UnicodeBox::Table       |       200 |    6      |                 0.00% |             55334.94% |   0.00017 |      20 |
     | Text::ANSITable               |       690 |    1.5    |               340.32% |             12489.56% | 5.2e-06   |      20 |
     | Text::Table::More             |       990 |    1      |               531.41% |              8679.51% | 2.9e-06   |      20 |
     | Text::Table::TinyBorderStyle  |      3800 |    0.26   |              2336.25% |              2175.42% | 3.8e-07   |      22 |
     | Text::Table::TinyWide         |      4000 |    0.3    |              2408.28% |              2110.08% | 2.7e-06   |      20 |
     | Text::ASCIITable              |      4700 |    0.21   |              2923.90% |              1733.22% | 6.5e-07   |      20 |
     | Text::TabularDisplay          |      6500 |    0.154  |              4055.56% |              1233.99% | 5.6e-08   |      24 |

README  view on Meta::CPAN

       Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
       Text::Table::TinyWide: participant=Text::Table::TinyWide
       Text::TabularDisplay: participant=Text::TabularDisplay
       Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

    The above result presented as chart:

    Result formatted as table (split, part 4 of 5):

     #table4#
     {dataset=>"tiny (1x1)"}
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
     | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
     | Text::UnicodeBox::Table       |       400 |   3       |                 0.00% |             81511.84% |   7e-05 |      20 |
     | Text::ANSITable               |      2000 |   0.6     |               345.42% |             18222.60% | 1.7e-05 |      20 |
     | Text::Table::More             |      3100 |   0.32    |               765.49% |              9329.53% | 1.4e-06 |      20 |
     | Text::Table::TinyBorderStyle  |      4500 |   0.22    |              1159.08% |              6381.86% | 9.5e-07 |      20 |
     | Text::Table::Manifold         |     14000 |   0.074   |              3687.92% |              2054.53% | 1.5e-07 |      20 |
     | Text::ASCIITable              |     18000 |   0.056   |              4864.62% |              1543.87% | 9.3e-08 |      21 |
     | Text::Table::HTML::DataTables |     19000 |   0.054   |              5093.75% |              1471.35% | 7.7e-08 |      21 |

README  view on Meta::CPAN

       Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
       Text::Table::TinyWide: participant=Text::Table::TinyWide
       Text::TabularDisplay: participant=Text::TabularDisplay
       Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

    The above result presented as chart:

    Result formatted as table (split, part 5 of 5):

     #table5#
     {dataset=>"wide (30x5)"}
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
     +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
     | Text::UnicodeBox::Table       |        33 |   30      |                 0.00% |             40107.73% |   0.00028 |      20 |
     | Text::ANSITable               |        70 |   10      |               112.30% |             18838.85% |   0.00034 |      20 |
     | Text::Table::More             |       100 |    9      |               242.25% |             11648.22% |   0.00016 |      20 |
     | Text::ASCIITable              |       450 |    2.2    |              1269.60% |              2835.73% | 1.8e-05   |      21 |
     | Text::FormatTable             |       650 |    1.5    |              1867.35% |              1943.75% | 1.2e-05   |      20 |
     | Text::Table::TinyColorWide    |       830 |    1.2    |              2401.71% |              1507.21% | 3.5e-06   |      20 |
     | Text::Table::TinyBorderStyle  |       900 |    1      |              2611.90% |              1382.64% | 1.7e-05   |      20 |

README  view on Meta::CPAN

       Text::Table::TinyColor: mod_overhead_time=11 participant=Text::Table::TinyColor
       Text::Table::TinyColorWide: mod_overhead_time=31 participant=Text::Table::TinyColorWide
       Text::Table::TinyWide: mod_overhead_time=27 participant=Text::Table::TinyWide
       Text::TabularDisplay: mod_overhead_time=1 participant=Text::TabularDisplay
       Text::UnicodeBox::Table: mod_overhead_time=181 participant=Text::UnicodeBox::Table
       perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)

    The above result presented as chart:

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

SAMPLE OUTPUTS
    This section shows what the output is like for (some of the) modules:

    *   "Text::Table::Any"

         +--------+--------+--------+
         | col1   | col2   | col3   |
         +--------+--------+--------+
         | row1.1 | row1.2 | row1.3 |

README  view on Meta::CPAN

         <tr><td>row3.1</td><td>row3.2</td><td>row3.3</td></tr>
         <tr><td>row4.1</td><td>row4.2</td><td>row4.3</td></tr>
         <tr><td>row5.1</td><td>row5.2</td><td>row5.3</td></tr>
         </tbody>
         </table>

    *   "Text::Table::HTML::DataTables"

         <html>
         <head>
         <link rel="stylesheet" type="text/css" href="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.css">
         <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/jquery-2.2.4/jquery-2.2.4.min.js"></script>
         <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.js"></script>
         <script>var dt_opts = {"buttons":["colvis","print"],"dom":"lQfrtip"}; $(document).ready(function() { $("table").DataTable(dt_opts); $("select[name=DataTables_Table_0_length]").val(1000); $("select[name=DataTables_Table_0_length]").trigger("c...
 
         </head>
 
         <body>
         <table>
         <thead>
         <tr><th>col1</th><th>col2</th><th>col3</th></tr>
         </thead>
         <tbody>

dist.ini  view on Meta::CPAN

[Bencher::Scenario]

[InsertCodeOutput]
make_verbatim=0

[@Author::PERLANCAR]
:version=0.608

; make sure we put this after PodWeaver to avoid getting mangled location
[InsertDistImage]
hosting=data

[Prereqs / TestRequires]
;Test::More=0.98

[Prereqs]
perl=5.010001
strict=0
utf8=0
warnings=0
;!lint_prereqs assume-used "force version"

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

    description => <<'_',

Currently excluded from this list are:

- <pm:Text::SimpleTable::AutoWidth> (wrapper to <pm:Text::SimpleTable>);
- <pm:Text::ASCIITable::EasyTable> (wrapper to <pm:Text::ASCIITable>);

_
    entry_features => {
        wide_char => {summary => 'Whether the use of wide characters (e.g. Kanji) in cells does not cause the table to be misaligned'},
        color_data =>  {summary => 'Whether module supports ANSI colors (i.e. text with ANSI color codes can still be aligned properly)'},
        multiline_data => {summary => 'Whether module supports aligning data cells that contain newlines'},

        box_char => {summary => 'Whether module can utilize box-drawing characters'},
        custom_border => {summary => 'Whether module allows customizing border in some way'},

        align_row => {summary => "Whether module supports aligning text horizontally in a row (left/right/middle)"},
        align_column => {summary => "Whether module supports aligning text horizontally in a column (left/right/middle)"},
        align_cell => {summary => "Whether module supports aligning text horizontally in individual cells (left/right/middle)"},

        valign_row => {summary => "Whether module supports aligning text vertically in a row (top/bottom/middle)"},
        valign_column => {summary => "Whether module supports aligning text vertically in a column (top/bottom/middle)"},

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

_
            bench_code => sub {
                my ($table) = @_;
                Text::Table::Any::table(rows=>$table, header_row=>1);
            },
            features => {
                align_cell     => {value=>undef, summary=>"Depends on backend"},
                align_column   => {value=>undef, summary=>"Depends on backend"},
                align_row      => {value=>undef, summary=>"Depends on backend"},
                box_char       => {value=>undef, summary=>"Depends on backend"},
                color_data     => {value=>undef, summary=>"Depends on backend"},
                color_theme    => {value=>undef, summary=>"Depends on backend"},
                colspan        => {value=>undef, summary=>"Depends on backend"},
                custom_border  => {value=>undef, summary=>"Depends on backend"},
                custom_color   => {value=>undef, summary=>"Depends on backend"},
                multiline_data => {value=>undef, summary=>"Depends on backend"},
                rowspan        => {value=>undef, summary=>"Depends on backend"},
                speed          => {value=>undef, summary=>"Depends on backend"},
                valign_cell    => {value=>undef, summary=>"Depends on backend"},
                valign_column  => {value=>undef, summary=>"Depends on backend"},
                valign_row     => {value=>undef, summary=>"Depends on backend"},
                wide_char_data => {value=>undef, summary=>"Depends on backend"},
            },
        },

        {
            module => 'Text::SimpleTable',
            description => <<'_',

As its name implies, a simple table-generating module with minimal documentation
and a few choices or border characters. You have to set the width of all columns
manually.

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

                my @colspec = map {[9, $_]} @{ $table->[0] };
                my $ts = Text::SimpleTable->new(@colspec);
                for (1 .. $#{$table}) { $ts->row(@{ $table->[$_] }) }
                $ts->draw;
            },
            features => {
                align_cell     => {value=>0},
                align_column   => {value=>0},
                align_row      => {value=>0},
                box_char       => {value=>0},
                color_data     => {value=>0},
                color_theme    => {value=>0},
                colspan        => {value=>0},
                custom_border  => {value=>1, summary=>"Limited choice of 1 ASCII style and 1 UTF style"},
                custom_color   => {value=>0},
                multiline_data => {value=>0},
                rowspan        => {value=>0},
                speed          => {value=>'fast', summary=>'Slightly slower than Text::Table::Tiny'},
                valign_cell    => {value=>0},
                valign_column  => {value=>0},
                valign_row     => {value=>0},
                wide_char_data => {value=>0},
            },
        },

        {
            module => 'Text::UnicodeBox::Table',
            description => <<'_',

The main feature of this module is the various border style it provides drawn
using Unicode box-drawing characters. It allows per-row style. The rendering
speed is particularly slow compared to other modules.

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

                my ($table) = @_;
                my $t = Text::UnicodeBox::Table->new;
                $t->add_header(@{ $table->[0] });
                $t->add_row(@{ $table->[$_] }) for 1..$#{$table};
                $t->render;
            },
            features => {
                align_cell => 0,
                align_column => 1,
                box_char => 0,
                color_data => 1,
                color_theme => 0,
                colspan => 0,
                custom_border => 1,
                custom_color => 0,
                multiline_data => 0,
                rowspan => 0,
                wide_char_data => 1,
                speed => "slow",
            },
        },

        {
            module => 'Text::Table::Manifold',
            description => <<'_',

Two main features of this module is per-column aligning and wide character
support. This module, aside from doing its rendering, can also be told to pass
rendering to HTML, CSV, or other text table module like
<pm:Text::UnicodeBox::Table>); so in this way it is similar to
<pm:Text::Table::Any>.

_
            bench_code => sub {
                my ($table) = @_;
                my $t = Text::Table::Manifold->new;
                $t->headers($table->[0]);
                $t->data([ @{$table}[1 .. $#{$table}] ]);
                join("\n", @{$t->render(padding => 1)}) . "\n";
            },
            features => {
                align_cell => 0,
                align_column => 1,
                box_char => undef, # ?
                color_data => 1,
                color_theme => 0,
                colspan => 0,
                custom_border => {value=>0, summary=>"But this module can pass rendering to other module like Text::UnicodeBox::Table"},
                custom_color => 0,
                multiline_data => 0,
                rowspan => 0,
                wide_char_data => 1,
            },
        },

        {
            module => 'Text::ANSITable',
            description => <<'_',

This 2013 project was my take in creating a text table module that can handle
color, multiline text, wide characters. I also threw in various formatting
options, e.g. per-column/row/cell align/valign/pad/vpad, conditional formatting,

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

                    border_style => 'ASCII::SingleLine',
                );
                $t->add_row($table->[$_]) for 1..@$table-1;
                $t->draw;
            },
            features => {
                align_cell => 1,
                align_column => 1,
                align_row => 1,
                box_char => 1,
                color_data =>  1,
                color_theme => 1,
                colspan => 0,
                column_width => 1,
                custom_border => 1,
                custom_color => 1,
                multiline_data => 1,
                pad => 1,
                per_column_width => 1,
                per_row_height => 1,
                row_height => 1,
                rowspan => 0,
                speed => "slow",
                valign_cell => 1,
                valign_column => 1,
                valign_row => 1,
                vpad => 1,
                wide_char_data => 1,
            },
        },

        {
            module => 'Text::ASCIITable',
            bench_code => sub {
                my ($table) = @_;
                my $t = Text::ASCIITable->new();
                $t->setCols(@{ $table->[0] });
                $t->addRow(@{ $table->[$_] }) for 1..@$table-1;
                "$t";
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 0,
                multiline_data => 1,
            },
        },
        {
            module => 'Text::FormatTable',
            bench_code => sub {
                my ($table) = @_;
                my $t = Text::FormatTable->new(join('|', ('l') x @{ $table->[0] }));
                $t->head(@{ $table->[0] });
                $t->row(@{ $table->[$_] }) for 1..@$table-1;
                $t->render;
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 0,
                multiline_data => 1,
            },
        },
        {
            module => 'Text::MarkdownTable',
            bench_code => sub {
                my ($table) = @_;
                my $out = "";
                my $t = Text::MarkdownTable->new(file => \$out);
                my $fields = $table->[0];
                foreach (1..@$table-1) {
                    my $row = $table->[$_];
                    $t->add( {
                        map { $fields->[$_] => $row->[$_] } 0..@$fields-1
                    });
                }
                $t->done;
                $out;
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 0,
                multiline_data => {value=>0, summary=>'Newlines stripped'},
            },
        },
        {
            module => 'Text::Table',
            bench_code => sub {
                my ($table) = @_;
                my $t = Text::Table->new(@{ $table->[0] });
                $t->load(@{ $table }[1..@$table-1]);
                $t;
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => {value=>undef, summary=>'Does not draw borders'},
                multiline_data => 1,
            },
        },
        {
            module => 'Text::Table::Tiny',
            description => <<'_',

The simple and tiny table-generating module which I liked back in 2012 (v0.03).
It employs an sprintf() trick to generate a single row. This module started my
personal experiments creating other table-generating modules (at last count I've
created no fewer than 15 of them!).

_
            bench_code => sub {
                my ($table) = @_;
                Text::Table::Tiny::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  1,
                box_char => 1,
                multiline_data => 0,
            },
        },
        {
            module => 'Text::Table::TinyBorderStyle',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::TinyBorderStyle::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 1,
                multiline_data => 0,
            },
        },
        {
            module => 'Text::Table::More',
            description => <<'_',

A module I wrote in early 2021. Main distinguishing feature is support for
rowspan/clospan. I plan to add more features to this module on an as-needed
basic. This module is now preferred to <pm:Text::ANSITable>, although currently
it does not offer nearly as many formatting options as Text::ANSITable.

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

_
            bench_code => sub {
                my ($table) = @_;
                Text::Table::More::generate_table(rows=>$table, header_row=>1);
            },
            features => {
                align_cell => 1,
                align_column => 1,
                align_row => 1,
                box_char => 1,
                color_data =>  1,
                color_theme => 0,
                colspan => 1,
                custom_border => 1,
                custom_color => 0,
                multiline_data => 1,
                rowspan => 1,
                speed => "slow",
                valign_cell => 1,
                valign_column => 1,
                valign_row => 1,
                wide_char_data => 1,
                column_width => 0, # todo
                per_column_width => 0, # todo
                row_height => 0, # todo
                per_row_height => 0, # todo
                pad => 0, # todo
                vpad => 0, # todo
            },
        },
        {
            module => 'Text::Table::Sprintf',

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

A performant (see benchmark result) and lightweight (a page of code, no use of
modules at all), but with minimal extra features.

_
            bench_code => sub {
                my ($table) = @_;
                Text::Table::Sprintf::table(rows=>$table, header_row=>1);
            },
            features => {
                box_char => 0,
                color_data =>  0,
                multiline_data => 0,
                speed => {value=>"fast", summary=>"The fastest among the others in this list"},
                wide_char_data => 0,
            },
        },
        {
            module => 'Text::Table::TinyColor',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::TinyColor::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 0,
                color_data =>  1,
                box_char => 0,
                multiline_data => 0,
            },
        },
        {
            module => 'Text::Table::TinyColorWide',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::TinyColorWide::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  1,
                box_char => 0,
                multiline_data => 0,
            },
        },
        {
            module => 'Text::Table::TinyWide',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::TinyWide::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  0,
                box_char => 0,
            },
        },
        {
            module => 'Text::Table::Org',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::Org::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 0,
                multiline_data => 0,
            },
        },
        {
            module => 'Text::Table::CSV',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::CSV::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  0,
                box_char => {value=>undef, summary=>"Irrelevant"},
                multiline_data => {value=>1, summary=>"But make sure your CSV parser can handle multiline cell"},
            },
        },
        {
            module => 'Text::Table::HTML',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::HTML::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  {value=>0, summary=>'Not converted to HTML color elements'},
                box_char => 0,
                multiline_data => 1,
            },
        },
        {
            module => 'Text::Table::HTML::DataTables',
            bench_code => sub {
                my ($table) = @_;
                Text::Table::HTML::DataTables::table(rows=>$table, header_row=>1);
            },
            features => {
                wide_char_data => 1,
                color_data =>  {value=>0, summary=>'Not converted to HTML color elements'},
                box_char => 0,
                multiline_data => 1,
            },
        },
        {
            module => 'Text::TabularDisplay',
            bench_code => sub {
                my ($table) = @_;
                my $t = Text::TabularDisplay->new(@{ $table->[0] });
                $t->add(@{ $table->[$_] }) for 1..@$table-1;
                $t->render; # doesn't add newline
            },
            features => {
                wide_char_data => 1,
                color_data =>  0,
                box_char => {value=>undef, summary=>"Irrelevant"},
                multiline_data => 1,
            },
        },
    ],

    bench_datasets => [
        {name=>'tiny (1x1)'          , argv => [_make_table( 1, 1)],},
        {name=>'small (3x5)'         , argv => [_make_table( 3, 5)],},
        {name=>'wide (30x5)'         , argv => [_make_table(30, 5)],},
        {name=>'long (3x300)'        , argv => [_make_table( 3, 300)],},
        {name=>'large (30x300)'      , argv => [_make_table(30, 300)],},
        {name=>'multiline data (2x1)', argv => [ [["col1", "col2"], ["foobar\nbaz\nqux\nquux","corge"]] ], include_by_default=>0 },
        {name=>'wide char data (1x2)', argv => [ [["col1"], ["no wide character"], ["宽字"]] ], include_by_default=>0 },
        {name=>'color data (1x2)'    , argv => [ [["col1"], ["no color"], ["\e[31m\e[1mwith\e[0m \e[32m\e[1mcolor\e[0m"]] ], include_by_default=>0 },
    ],

};

1;
# ABSTRACT: List of modules that generate text tables

__END__

=pod

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

=head1 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 L<bencher> or run C<bencher --help>.

=head1 DESCRIPTION

Currently excluded from this list are:

=over

=item * L<Text::SimpleTable::AutoWidth> (wrapper to L<Text::SimpleTable>);

=item * L<Text::ASCIITable::EasyTable> (wrapper to L<Text::ASCIITable>);

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


=item L<Text::TabularDisplay>

Author: L<DARREN|https://metacpan.org/author/DARREN>

=back

=head1 ACME::CPANMODULES FEATURE COMPARISON MATRIX

 +-------------------------------+----------------+------------------+---------------+--------------+----------------+-----------------+-------------+-------------------+------------------+---------------------+--------------+------------+-----------...
 | module                        | align_cell *1) | align_column *2) | align_row *3) | box_char *4) | color_data *5) | color_theme *6) | colspan *7) | custom_border *8) | custom_color *9) | multiline_data *10) | rowspan *11) | speed *12) | valign_cel...
 +-------------------------------+----------------+------------------+---------------+--------------+----------------+-----------------+-------------+-------------------+------------------+---------------------+--------------+------------+-----------...
 | Text::Table::Any              | N/A *22)       | N/A *22)         | N/A *22)      | N/A *22)     | N/A *22)       | N/A *22)        | N/A *22)    | N/A *22)          | N/A *22)         | N/A *22)            | N/A *22)     | N/A *22)   | N/A *22)  ...
 | Text::SimpleTable             | no             | no               | no            | no           | no             | no              | no          | yes *23)          | no               | no                  | no           | fast *24)  | no        ...
 | Text::UnicodeBox::Table       | no             | yes              | N/A           | no           | yes            | no              | no          | yes               | no               | no                  | no           | slow       | N/A       ...
 | Text::Table::Manifold         | no             | yes              | N/A           | N/A          | yes            | no              | no          | no *25)           | no               | no                  | no           | N/A        | N/A       ...
 | Text::ANSITable               | yes            | yes              | yes           | yes          | yes            | yes             | no          | yes               | yes              | yes                 | no           | slow       | yes       ...
 | Text::ASCIITable              | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A       ...
 | Text::FormatTable             | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A       ...
 | Text::MarkdownTable           | N/A            | N/A              | N/A           | no           | no             | N/A             | N/A         | N/A               | N/A              | no *26)             | N/A          | N/A        | N/A       ...
 | Text::Table                   | N/A            | N/A              | N/A           | N/A *27)     | no             | N/A             | N/A         | N/A               | N/A              | yes                 | N/A          | N/A        | N/A       ...

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

=over

=item 1. align_cell: Whether module supports aligning text horizontally in individual cells (left/right/middle)

=item 2. align_column: Whether module supports aligning text horizontally in a column (left/right/middle)

=item 3. align_row: Whether module supports aligning text horizontally in a row (left/right/middle)

=item 4. box_char: Whether module can utilize box-drawing characters

=item 5. color_data: Whether module supports ANSI colors (i.e. text with ANSI color codes can still be aligned properly)

=item 6. color_theme: Whether the module supports color theme/scheme

=item 7. colspan: Whether module supports column spans

=item 8. custom_border: Whether module allows customizing border in some way

=item 9. custom_color: Whether the module produces colored table and supports customizing color in some way

=item 10. multiline_data: Whether module supports aligning data cells that contain newlines

=item 11. rowspan: Whether module supports row spans

=item 12. speed: Rendering speed

=item 13. valign_cell: Whether module supports aligning text vertically in individual cells (top/bottom/middle)

=item 14. valign_column: Whether module supports aligning text vertically in a column (top/bottom/middle)

=item 15. valign_row: Whether module supports aligning text vertically in a row (top/bottom/middle)

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

=item * tiny (1x1)

=item * small (3x5)

=item * wide (30x5)

=item * long (3x300)

=item * large (30x300)

=item * multiline data (2x1) (not included by default)

=item * wide char data (1x2) (not included by default)

=item * color data (1x2) (not included by default)

=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 TextTable

Result formatted as table (split, part 1 of 5):

 #table1#
 {dataset=>"large (30x300)"}
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | Text::UnicodeBox::Table       |      0.92 |    1100   |                 0.00% |             35566.44% |   0.0024  |      20 |
 | Text::ANSITable               |      1.8  |     560   |                94.68% |             18220.90% |   0.0012  |      20 |
 | Text::Table::More             |      2.5  |     400   |               167.94% |             13211.33% |   0.00094 |      20 |
 | Text::ASCIITable              |      9.6  |     100   |               934.43% |              3347.94% |   0.00076 |      20 |
 | Text::Table::TinyColorWide    |     10    |      70   |              1365.67% |              2333.45% |   0.0008  |      20 |
 | Text::FormatTable             |     15    |      69   |              1474.71% |              2164.95% |   0.00063 |      20 |
 | Text::Table::TinyWide         |     20    |      50   |              1927.24% |              1659.36% |   0.00058 |      20 |

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

   Text::Table::TinyColor: participant=Text::Table::TinyColor
   Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: participant=Text::Table::TinyWide
   Text::TabularDisplay: participant=Text::TabularDisplay
   Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


Result formatted as table (split, part 2 of 5):

 #table2#
 {dataset=>"long (3x300)"}
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | Text::UnicodeBox::Table       |       7.4 |   140     |                 0.00% |             35069.88% |   0.0005  |      20 |
 | Text::ANSITable               |      17   |    58     |               132.94% |             14998.05% |   0.00043 |      21 |
 | Text::Table::More             |      21   |    49     |               178.85% |             12512.60% |   0.00046 |      20 |
 | Text::ASCIITable              |     100   |    10     |              1223.05% |              2558.25% |   0.00022 |      22 |
 | Text::FormatTable             |     100   |     8     |              1644.13% |              1916.47% |   0.00026 |      21 |
 | Text::Table::TinyColorWide    |     100   |     7     |              1789.53% |              1761.30% |   0.00016 |      20 |
 | Text::Table::TinyWide         |     200   |     5     |              2638.44% |              1184.31% | 6.1e-05   |      20 |

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

   Text::Table::TinyColor: participant=Text::Table::TinyColor
   Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: participant=Text::Table::TinyWide
   Text::TabularDisplay: participant=Text::TabularDisplay
   Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


Result formatted as table (split, part 3 of 5):

 #table3#
 {dataset=>"small (3x5)"}
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | Text::UnicodeBox::Table       |       200 |    6      |                 0.00% |             55334.94% |   0.00017 |      20 |
 | Text::ANSITable               |       690 |    1.5    |               340.32% |             12489.56% | 5.2e-06   |      20 |
 | Text::Table::More             |       990 |    1      |               531.41% |              8679.51% | 2.9e-06   |      20 |
 | Text::Table::TinyBorderStyle  |      3800 |    0.26   |              2336.25% |              2175.42% | 3.8e-07   |      22 |
 | Text::Table::TinyWide         |      4000 |    0.3    |              2408.28% |              2110.08% | 2.7e-06   |      20 |
 | Text::ASCIITable              |      4700 |    0.21   |              2923.90% |              1733.22% | 6.5e-07   |      20 |
 | Text::TabularDisplay          |      6500 |    0.154  |              4055.56% |              1233.99% | 5.6e-08   |      24 |

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

   Text::Table::TinyColor: participant=Text::Table::TinyColor
   Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: participant=Text::Table::TinyWide
   Text::TabularDisplay: participant=Text::TabularDisplay
   Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


Result formatted as table (split, part 4 of 5):

 #table4#
 {dataset=>"tiny (1x1)"}
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors | samples |
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
 | Text::UnicodeBox::Table       |       400 |   3       |                 0.00% |             81511.84% |   7e-05 |      20 |
 | Text::ANSITable               |      2000 |   0.6     |               345.42% |             18222.60% | 1.7e-05 |      20 |
 | Text::Table::More             |      3100 |   0.32    |               765.49% |              9329.53% | 1.4e-06 |      20 |
 | Text::Table::TinyBorderStyle  |      4500 |   0.22    |              1159.08% |              6381.86% | 9.5e-07 |      20 |
 | Text::Table::Manifold         |     14000 |   0.074   |              3687.92% |              2054.53% | 1.5e-07 |      20 |
 | Text::ASCIITable              |     18000 |   0.056   |              4864.62% |              1543.87% | 9.3e-08 |      21 |
 | Text::Table::HTML::DataTables |     19000 |   0.054   |              5093.75% |              1471.35% | 7.7e-08 |      21 |

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

   Text::Table::TinyColor: participant=Text::Table::TinyColor
   Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: participant=Text::Table::TinyWide
   Text::TabularDisplay: participant=Text::TabularDisplay
   Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


Result formatted as table (split, part 5 of 5):

 #table5#
 {dataset=>"wide (30x5)"}
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | participant                   | rate (/s) | time (ms) | pct_faster_vs_slowest | pct_slower_vs_fastest |  errors   | samples |
 +-------------------------------+-----------+-----------+-----------------------+-----------------------+-----------+---------+
 | Text::UnicodeBox::Table       |        33 |   30      |                 0.00% |             40107.73% |   0.00028 |      20 |
 | Text::ANSITable               |        70 |   10      |               112.30% |             18838.85% |   0.00034 |      20 |
 | Text::Table::More             |       100 |    9      |               242.25% |             11648.22% |   0.00016 |      20 |
 | Text::ASCIITable              |       450 |    2.2    |              1269.60% |              2835.73% | 1.8e-05   |      21 |
 | Text::FormatTable             |       650 |    1.5    |              1867.35% |              1943.75% | 1.2e-05   |      20 |
 | Text::Table::TinyColorWide    |       830 |    1.2    |              2401.71% |              1507.21% | 3.5e-06   |      20 |
 | Text::Table::TinyBorderStyle  |       900 |    1      |              2611.90% |              1382.64% | 1.7e-05   |      20 |

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

   Text::Table::TinyColor: participant=Text::Table::TinyColor
   Text::Table::TinyColorWide: participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: participant=Text::Table::TinyWide
   Text::TabularDisplay: participant=Text::TabularDisplay
   Text::UnicodeBox::Table: participant=Text::UnicodeBox::Table

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


=head2 Sample benchmark #2

Benchmark command (benchmarking module startup overhead):

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

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

   Text::Table::TinyColorWide: mod_overhead_time=31 participant=Text::Table::TinyColorWide
   Text::Table::TinyWide: mod_overhead_time=27 participant=Text::Table::TinyWide
   Text::TabularDisplay: mod_overhead_time=1 participant=Text::TabularDisplay
   Text::UnicodeBox::Table: mod_overhead_time=181 participant=Text::UnicodeBox::Table
   perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)

The above result presented as chart:

=begin html

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...

=end html


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

=head1 SAMPLE OUTPUTS

This section shows what the output is like for (some of the) modules:

=over

=item * L</Text::Table::Any>

 +--------+--------+--------+

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

 <tr><td>row3.1</td><td>row3.2</td><td>row3.3</td></tr>
 <tr><td>row4.1</td><td>row4.2</td><td>row4.3</td></tr>
 <tr><td>row5.1</td><td>row5.2</td><td>row5.3</td></tr>
 </tbody>
 </table>

=item * L</Text::Table::HTML::DataTables>

 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.css">
 <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/jquery-2.2.4/jquery-2.2.4.min.js"></script>
 <script src="file:///home/u1/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.22/datatables.js"></script>
 <script>var dt_opts = {"buttons":["colvis","print"],"dom":"lQfrtip"}; $(document).ready(function() { $("table").DataTable(dt_opts); $("select[name=DataTables_Table_0_length]").val(1000); $("select[name=DataTables_Table_0_length]").trigger("change");...
 
 </head>
 
 <body>
 <table>
 <thead>
 <tr><th>col1</th><th>col2</th><th>col3</th></tr>
 </thead>
 <tbody>

lib/Acme/CPANModules_ScenarioR/TextTable.pm  view on Meta::CPAN

## no critic
package Acme::CPANModules_ScenarioR::TextTable;

our $VERSION = 0.016; # VERSION

our $results = do{my$var=[[200,"OK",[{_name=>"participant=Text::UnicodeBox::Table",_succinct_name=>"Text::UnicodeBox::Table",errors=>0.0024,participant=>"Text::UnicodeBox::Table",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>365.666666666667,rate=>...

1;
# ABSTRACT: List of modules that generate text tables

=head1 DESCRIPTION

This module is automatically generated by Pod::Weaver::Plugin::Bencher::Scenario during distribution build.

A Acme::CPANModules_ScenarioR::* module contains the raw result of sample benchmark and might be useful for some stuffs later.

weaver.ini  view on Meta::CPAN

[@Author::PERLANCAR]

[-Acme::CPANModules]

[-Bencher::Scenario]
result_split_fields=dataset
chart=1



( run in 0.344 second using v1.01-cache-2.11-cpan-8d75d55dd25 )