[sf-perl] Perl installation performance benchmark

David Christensen dpchrist at holgerdanske.com
Sat May 28 23:25:21 PDT 2022


On 5/26/22 19:21, Shlomi Fish wrote:
> Hi David!
> 
> On Thu, 26 May 2022 18:07:13 -0700
> David Christensen <dpchrist at holgerdanske.com> wrote:
> 
>> sanfrancisco-pm:
>>
>> I have Perl installed on various x86_64 (amd64) architecture machines --
>> Windows/ Cygwin, macOS, GNU/Linux, and FreeBSD.  I am looking for a
>> simple multi-platform benchmark that I can use to gauge performance of a
>> Perl installation on any supported platform -- e.g. something like 'time
>> perl benchmark.pl' or 'make benchmark'.  (I can use additional tools to
>> "dig deeper".)  It would be best if the benchmark only required core
>> Perl and if the benchmark supported versions released over the past
>> decade or so.  I use threads for concurrency, so it would be nice if the
>> benchmark included an option for that (e.g. '-j=4' or 'export
>> HARNESS_OPTIONS=j4').  Any suggestions?
>>
> 
> Perhaps my
> https://github.com/shlomif/black-hole-solitaire/blob/master/black-hole-solitaire/benchmark/benchmark-perl.bash
> will be acceptable.


Thank you for the suggestion.  :-)


I would like to keep it as simple as possible -- something like:

1.  Install Perl on target platform.

2022-05-28 22:38:29 dpchrist at laalaa ~
$ lscpu | grep 'Model name' ; cat /etc/debian_version ; uname -a ; perl 
-v | head -n 2 | tail -n 1
Model name:                      Intel(R) Core(TM)2 CPU         T7400  @ 
2.16GHz
11.3
Linux laalaa 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) 
x86_64 GNU/Linux
This is perl 5, version 32, subversion 1 (v5.32.1) built for 
x86_64-linux-gnu-thread-multi


2.  Pick some mature CPAN modules that only require core Perl.  For 
example, Log::Log4perl:

https://metacpan.org/release/ETJ/Log-Log4perl-1.54/source/Makefile.PL


3.  Download the source tarball(s):

2022-05-28 22:39:53 dpchrist at laalaa ~
$ cd build

2022-05-28 22:40:13 dpchrist at laalaa ~/build
$ wget 
https://cpan.metacpan.org/authors/id/E/ET/ETJ/Log-Log4perl-1.54.tar.gz
<snip>


4. Make and test each module, using the EUMM test results, Bash 'time' 
output values, and/or other values as performance metrics:

2022-05-28 22:48:16 dpchrist at laalaa ~/build
$ tar -xzf Log-Log4perl-1.54.tar.gz

2022-05-28 22:49:24 dpchrist at laalaa ~/build
$ cd Log-Log4perl-1.54/

2022-05-28 22:52:04 dpchrist at laalaa ~/build/Log-Log4perl-1.54
$ time perl Makefile.PL
<snip>
real	0m0.336s
user	0m0.282s
sys	0m0.052s

2022-05-28 22:52:10 dpchrist at laalaa ~/build/Log-Log4perl-1.54
$ time make
<snip>
real	0m1.938s
user	0m1.759s
sys	0m0.151s

2022-05-28 22:52:16 dpchrist at laalaa ~/build/Log-Log4perl-1.54
$ time make test
<snip>
All tests successful.
Files=73, Tests=721, 37 wallclock secs ( 0.35 usr  0.14 sys + 10.85 cusr 
  1.71 csys = 13.05 CPU)
Result: PASS

real	0m37.214s
user	0m11.335s
sys	0m1.867s

2022-05-28 22:52:57 dpchrist at laalaa ~/build/Log-Log4perl-1.54
$ export HARNESS_OPTIONS='j2'

2022-05-28 22:55:06 dpchrist at laalaa ~/build/Log-Log4perl-1.54
$ time make test
<snip>
All tests successful.
Files=73, Tests=721, 19 wallclock secs ( 0.36 usr  0.16 sys + 11.16 cusr 
  1.75 csys = 13.43 CPU)
Result: PASS

real	0m19.259s
user	0m11.639s
sys	0m1.939s


Enhancements could include:

1.  Read module tarball URL's from a configuration file.

2.  Save output into automatically-named files.

3.  Build tools to parse output and/or files, and generate reports.


David


More information about the SanFrancisco-pm mailing list