I grabbed perlbench from CPAN and did some more benchmarks. These confirmed what we already suspected, i.e. there are no significant performance differences in Perl itself between 5.6.1, 5.8.0, and 5.8.1, but the stock Perl on Red Hat 9 (which is compiled with threads) is significantly slower than a default compile of any recent Perl on the same system.
All of the Perls that I compiled were done with default options.
The output of perlbench is attached.
Thanks Perrin for this comparison numbers, but I think you didn't provide enough build information. Default build opts vary from release to release and from OS to OS, you really need to show the whole perl -V to make these numbers more useful.
In any case as the "Practical mod_perl" book suggests you should never blindly follow any benchmarks that you see, but to benchmark your own thing and come to your conclusions. This is because there are many factors that may make the benchmarks show quite a different picture in your case.
What's for sure is that as of this writing, enabling ithreads won't make your perl faster ;)
A) perl-5.006001 path = /usr/local/perl56/bin/perl cc = cc optimize = -O2 ccflags = -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 usemymalloc = n
B) perl-5.008 path = /usr/local/perl580/bin/perl cc = cc optimize = -O3 ccflags = -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm usemymalloc = n
C) perl-5.008001 path = /usr/local/perl581/bin/perl cc = cc optimize = -O3 ccflags = -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm usemymalloc = n
D) perl-5.008 path = /usr/bin/perl cc = gcc optimize = -O2 -g -pipe -march=i386 -mcpu=i686 ccflags = -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm usemymalloc = n
You mean RH's perl comes with perl built with -DDEBUGGING? how silly ;) This option definitely adds to the size perl lib and its run-time slowdown. Someone please report to the RH guys. I've CC'ed Chip on this reply, in case he still maintains this package.
Though I think it's also compiled with ithreads, whereas all others are without, so it's not a fair comparison across different perl versions. You can compare 5.6.0 with 5.8.0 using the same build options, or you can compare 5.8.0 w/ and w/o threads, but not the cross of these. I guess your B and D items should be looked at as one comparison group and A and C as another.
FWIW, here is the perl -V of perl-5.8.1 (really 5.8.1-RC4) that comes with Mandrake 9.2:
% perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
Platform:
osname=linux, osvers=2.4.18-23mdksmp, archname=i386-linux-thread-multi
uname='linux hp6.mandrakesoft.com 2.4.18-23mdksmp #1 smp fri aug 2 12:31:40 cest 2002 i686 unknown unknown gnulinux '
config_args='-des -Dinc_version_list=5.8.0/i386-linux-thread-multi 5.8.0 5.6.1 5.6.0 -Darchname=i386-linux -Dcc=gcc -Doptimize=-O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dman3ext=3pm -Dcf_by=MandrakeSoft -Dmyhostname=localhost [EMAIL PROTECTED] -Dd_dosuid -Ud_csh -Duseshrplib -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro ',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.3.1 (Mandrake Linux 9.2 3.3.1-1mdk)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
RC4
Built under linux
Compiled at Sep 1 2003 17:29:01
%ENV:
PERLDOC_PAGER="less -R"
@INC:
/usr/lib/perl5/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/5.8.1
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html