These module were tested building the same structure, a Bootstrap4 modal from their documentation.
The code for each of these tests is in the source for this file.
use Benchmark ':all'; timethese 10_000, { 'HTML::Builder' => sub{ Bench::HTML::Builder::modal 'this is my modal' }, 'HTML::Tiny', => sub{ Bench::HTML::Tiny::modal 'this is my modal' }, 'HTML::HTML5::Builder' => sub{ Bench::HTML::HTML5::Builder::modal 'this is my modal' }, 'HTML::Untidy' => sub{ Bench::HTML::Untidy::modal 'this is my modal' }, }; Benchmark: timing 10000 iterations of HTML::Builder, HTML::HTML5::Builder, HTML::Tiny, HTML::Untidy... HTML::Builder: 66 wallclock secs (33.58 usr + 31.68 sys = 65.26 CPU) @ 153.23/s (n=10000) HTML::HTML5::Builder: 5 wallclock secs ( 5.30 usr + 0.00 sys = 5.30 CPU) @ 1886.79/s (n=10000) HTML::Tiny: 2 wallclock secs ( 1.38 usr + 0.00 sys = 1.38 CPU) @ 7246.38/s (n=10000) HTML::Untidy: 1 wallclock secs ( 0.88 usr + 0.00 sys = 0.88 CPU) @ 11363.64/s (n=10000)
To install HTML::Untidy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Untidy
CPAN shell
perl -MCPAN -e shell install HTML::Untidy
For more information on module installation, please visit the detailed CPAN module installation guide.