Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

[rt.cpan.org #72928] Dprof/dprofpp reports incorrect subroutine call count if #Calls > 999999 #8054

Closed p5pRT closed 12 years ago

p5pRT commented 19 years ago

Migrated from rt.perl.org#36795 (status was 'rejected')

Searchable as RT36795$

p5pRT commented 19 years ago

From wfischer@lanl.gov

This is a bug report for perl from wfischer@​lanl.gov\, generated with the help of perlbug 1.34 running under perl v5.8.1.


Dprof/dprofpp reports incorrect subroutine call count if calls > 999999 (possibly the problem is in dprofpp)

In this version of Dprof/dprofpp\, the #Calls field is apparently
limited to 6 characters​: values >= 10**6 are truncated (keeping the left-most 6
digits only).

For example\, the following one-liner calls a no-op subroutine 1\,234\,567
times\, but only 123\,456 calls are reported​:

% perl -d​:Dprof -e 'sub just_call_it { return } for (1..1234567) {
just_call_it() }' % dprofpp Total Elapsed Time = 6.433940 Seconds   User+System Time = 0 Seconds Exclusive Times   %Time ExclSec CumulS #Calls sec/call Csec/c Name   0.00 - -1.133 123456 - - main​::just_call_it

I was going crazy trying to figure why my subroutine was slowing down
for different data set\, when in fact there were simply more calls to it



Flags​:   category=utilities   severity=medium


Site configuration information for perl v5.8.1​:

Configured by root at Fri Sep 12 19​:46​:46 PDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1 RC3)
configuration​:   Platform​:   osname=darwin\, osvers=7.0\, archname=darwin-thread-multi-2level   uname='darwin hampsten 7.0 darwin kernel version 6.0​: fri jul 25
16​:58​:41 pdt 2003;
root​:xnu-344.frankd.rootsxnu-344.frankd~objrelease_ppc power macintosh
powerpc '   config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe
-Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'   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='cc'\, ccflags ='-g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'\,   optimize='-Os'\,   cppflags='-no-cpp-precomp -g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'   ccversion=''\, gccversion='3.3 20030304 (Apple Computer\, Inc. build
1495)'\, gccosandvers=''   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=8   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\,
lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc'\, ldflags ='-L/usr/local/lib'   libpth=/usr/local/lib /usr/lib   libs=-ldbm -ldl -lm -lc   perllibs=-ldl -lm -lc   libc=/usr/lib/libc.dylib\, so=dylib\, useshrplib=true\,
libperl=libperl.dylib   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_dyld.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags=' '\, lddlflags='-bundle -undefined dynamic_lookup
-L/usr/local/lib'

Locally applied patches​:   RC3


@​INC for perl v5.8.1​:   /System/Library/Perl/5.8.1/darwin-thread-multi-2level   /System/Library/Perl/5.8.1   /Library/Perl/5.8.1/darwin-thread-multi-2level   /Library/Perl/5.8.1   /Library/Perl   /Network/Library/Perl/5.8.1/darwin-thread-multi-2level   /Network/Library/Perl/5.8.1   /Network/Library/Perl   .


Environment for perl v5.8.1​:   DYLD_LIBRARY_PATH (unset)   HOME=/Users/wfischer   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)  
PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:.​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:.​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:.   PERL_BADLANG (unset)   SHELL=/bin/bash

p5pRT commented 12 years ago

From @jkeenan

On Wed Aug 03 13​:36​:01 2005\, wfischer@​lanl.gov wrote​:

Dprof/dprofpp reports incorrect subroutine call count if calls > 999999 (possibly the problem is in dprofpp)

In this version of Dprof/dprofpp\, the #Calls field is apparently
limited to 6 characters​: values >= 10**6 are truncated (keeping the left-most 6
digits only).

For example\, the following one-liner calls a no-op subroutine 1\,234\,567
times\, but only 123\,456 calls are reported​:

Problem confirmed. Can we assume that setting an upper bound to the number of calls is necessary and prudent? If so\, what would be more rational behavior? Running 999\,999 calls and then issuing a warning? Are there other versions of dprofpp which behave differently/better?

Thank you very much. Jim Keenan

p5pRT commented 12 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 12 years ago

From @jkeenan

On Wed Aug 03 13​:36​:01 2005\, wfischer@​lanl.gov wrote​:

Dprof/dprofpp reports incorrect subroutine call count if calls > 999999 (possibly the problem is in dprofpp)

I should note that 'perldoc Devel​::DProf' now states​:

"Devel​::DProf" is DEPRECATED and will be removed from a future version of Perl. We strongly recommend that you install and use Devel​::NYTProf instead\, as it offers significantly improved profiling and reporting.

p5pRT commented 12 years ago

From @doy

On Sat\, Dec 03\, 2011 at 08​:42​:25PM -0800\, James E Keenan via RT wrote​:

On Wed Aug 03 13​:36​:01 2005\, wfischer@​lanl.gov wrote​:

Dprof/dprofpp reports incorrect subroutine call count if calls > 999999 (possibly the problem is in dprofpp)

I should note that 'perldoc Devel​::DProf' now states​:

"Devel​::DProf" is DEPRECATED and will be removed from a future version of Perl. We strongly recommend that you install and use Devel​::NYTProf instead\, as it offers significantly improved profiling and reporting.

And\, it has already been removed in 5.15.0. I'm fairly sure it's no longer being developed.

-doy

p5pRT commented 12 years ago

From @cpansprout

Forwarding to the CPAN queue....

On Wed Aug 03 13​:36​:01 2005\, wfischer@​lanl.gov wrote​:

This is a bug report for perl from wfischer@​lanl.gov\, generated with the help of perlbug 1.34 running under perl v5.8.1.

----------------------------------------------------------------- Dprof/dprofpp reports incorrect subroutine call count if calls > 999999 (possibly the problem is in dprofpp)

In this version of Dprof/dprofpp\, the #Calls field is apparently
limited to 6 characters​: values >= 10**6 are truncated (keeping the left-most 6
digits only).

For example\, the following one-liner calls a no-op subroutine 1\,234\,567
times\, but only 123\,456 calls are reported​:

% perl -d​:Dprof -e 'sub just_call_it { return } for (1..1234567) {
just_call_it() }' % dprofpp Total Elapsed Time = 6.433940 Seconds User+System Time = 0 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 0.00 - -1.133 123456 - - main​::just_call_it

I was going crazy trying to figure why my subroutine was slowing down
for different data set\, when in fact there were simply more calls to it

----------------------------------------------------------------- --- Flags​: category=utilities severity=medium --- Site configuration information for perl v5.8.1​:

Configured by root at Fri Sep 12 19​:46​:46 PDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1 RC3)
configuration​: Platform​: osname=darwin\, osvers=7.0\, archname=darwin-thread-multi-2level uname='darwin hampsten 7.0 darwin kernel version 6.0​: fri jul 25
16​:58​:41 pdt 2003;
root​:xnu-344.frankd.rootsxnu-344.frankd~objrelease_ppc power macintosh
powerpc ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe
-Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib' 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='cc'\, ccflags ='-g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'\, optimize='-Os'\, cppflags='-no-cpp-precomp -g -pipe -pipe -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -I/usr/local/include' ccversion=''\, gccversion='3.3 20030304 (Apple Computer\, Inc. build
1495)'\, gccosandvers='' intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321 d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=8 ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\,
lseeksize=8 alignbytes=8\, prototype=define Linker and Libraries​: ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc'\, ldflags ='-L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib\, so=dylib\, useshrplib=true\,
libperl=libperl.dylib gnulibc_version='' Dynamic Linking​: dlsrc=dl_dyld.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' ' cccdlflags=' '\, lddlflags='-bundle -undefined dynamic_lookup
-L/usr/local/lib'

Locally applied patches​: RC3

--- @​INC for perl v5.8.1​: /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl .

--- Environment for perl v5.8.1​: DYLD_LIBRARY_PATH (unset) HOME=/Users/wfischer LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset)

PATH=/bin​:/sbin​:/usr/bin​:/usr/sbin​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:.​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:.​:/sw/bin​:/Users/wfischer/scripts​:/ Users/wfischer/bin​:/Developer/Tools​:/usr/local/bin​:/Volumes/t10-samba1/ scripts​:/Volumes/T10-NET;FLY/scripts​:/System/Library/Frameworks/ Python.framework/Versions/2.3/bin​:. PERL_BADLANG (unset) SHELL=/bin/bash

--

Father Chrysostomos

p5pRT commented 12 years ago

@cpansprout - Status changed from 'open' to 'rejected'