Atomize and test comment stripping
Change-Id: Id798c8bac96214f29659b2764f8861539d6f5210
diff --git a/xt/benchmark.pl b/xt/benchmark.pl
index d8e3b2a..35c0c65 100644
--- a/xt/benchmark.pl
+++ b/xt/benchmark.pl
@@ -12,6 +12,8 @@
unshift @INC, "$FindBin::Bin/../lib";
};
+use KorAP::XML::TEI;
+
my $columns = 0;
my $no_header = 0;
GetOptions(
@@ -38,6 +40,8 @@
verbosity => 0
);
+my $result;
+
# Add benchmark instances
$bench->add_instances(
Dumbbench::Instance::PerlSub->new(
@@ -45,7 +49,18 @@
code => sub {
`cat '$file' | perl '$script' > /dev/null 2>&1`
}
- )
+ ),
+ Dumbbench::Instance::PerlSub->new(
+ name => 'delHTMLcom',
+ code => sub {
+ for (1..100_000) {
+ $result = KorAP::XML::TEI::delHTMLcom(
+ \*STDIN,
+ "This <!-- comment --> is a test " . $_
+ );
+ };
+ }
+ ),
);
# Run benchmarks