File: bench.pl

package info (click to toggle)
libunicode-casefold-perl 1.01-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 352 kB
  • sloc: perl: 366; makefile: 3
file content (13 lines) | stat: -rw-r--r-- 347 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
use Unicode::CaseFold;
use charnames ':full';
use Benchmark 'cmpthese';

my $str = "Wei\N{LATIN SMALL LETTER SHARP S}" x 1000;

cmpthese(-10,
  {
    fc       => sub { my $throwaway = Unicode::CaseFold::fc($str) },
    casefold => sub { my $throwaway = Unicode::CaseFold::case_fold($str) },
    lc       => sub { my $throwaway = lc $str },
  }
);