On Mon, Jul 06, 2009 at 09:49:17PM -0500, Elliot Shank wrote: > > Tim Bunce wrote: > > So, can you give r796 a whirl and let us know how it goes? > > Success! > > But first, failure! :] > > r796-r805 all result in a compilation failure: > > /some/path/perl-5.10.0/bin/perl /some/other/path/lib/perl5/ExtUtils/xsubpp > -typemap /some/path/perl-5.10.0/lib/5.10.0/ExtUtils/typemap -typemap typemap > NYTProf.xs > NYTProf.xsc && mv NYTProf.xsc NYTProf.c > cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gdbm -O2 -DVERSION=\"2.10\" -DXS_VERSION=\"2.10\" -fPIC > "-I/some/path/perl-5.10.0/lib/5.10.0/x86_64-linux-thread-multi/CORE" > -DHAS_CLOCK_GETTIME -DHAS_ZLIB -W -Wall -Wpointer-arith -Wbad-function-cast > -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn > -Wno-unused-parameter NYTProf.c > NYTProf.xs:349: error: expected â or â before â token
What C compiler and version are you using? If it's the same one that built your perl: gccversion='3.4.6 20060404 (Red Hat 3.4.6-8)' then it's ancient! And what does "perl -V:d_attribut" say? > NYTProf.xs: In function â: Sure seems like there's something odd about your compiler. > Once I got past that, I got brilliant results. :] My big cost was > Moose type constraint validation. At first, I was stumped as to which > specific attribute I should be looking at or whether it was Moose in > general. But then I noticed that the second sub in the exclusive time > list was in Moose::Meta::TypeConstraint::Union. Ah, validating a > union constraint definitely sounds expensive. I had to to ack the > code to remember exactly where I had done it. Once I had commented > out an "isa => 'HashRef[Str|ArrayRef[Str]]'", I got a 19% reduction in > elapsed time. Score! Great! I'm hoping the new code I'm writing to track the calling subroutine name will make NYTProf work better with Moose. (It'll certainly enable some useful new reports and visualizations I'm looking forward to working on.) > Unfortunately, further gains do not look to be as easy; the most > expensive sub after that change doesn't have any real single hot spots. Tuning mantra: If you can't make it faster, do it less often ;) Tuning mantra: Lots of small improvements add up. Though given the age of your compiler, I'd suggest installing a current GCC (4.4.x), rebuilding perl (5.10.1-tobe, without threads if you don't need them) and recompiling NYTProf. > In regards to the earlier question, as you can see below, an int is 32 > bits; however, it is a fully 64 bit perl. A 32bit int confirms my earlier suspicions. Thanks. Tim. > Summary of my perl5 (revision 5 version 10 subversion 0) configuration: > Platform: > osname=linux, osvers=2.6.9-55.elsmp, archname=x86_64-linux-thread-multi > uname='linux hostname 2.6.9-55.elsmp #1 smp fri apr 20 16:36:54edt 2007 > x86_64 x86_64 x86_64 gnulinux ' > config_args='-des -Dprefix=/some/path/perl-5.10.0 -Dusethreads' > hint=recommended, useposix=true, d_sigaction=define > useithreads=define, usemultiplicity=define > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gdbm', > optimize='-O2', > cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe > -I/usr/local/include -I/usr/include/gdbm' > ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-8)', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 > libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc > libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.3.4' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' > > > Characteristics of this binary (from libperl): Compile-time options: > MULTIPLICITY PERL_DONT_CREATE_GVSV > PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL > USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES > USE_PERLIO USE_REENTRANT_API > Built under linux > Compiled at Dec 5 2008 14:26:49 > @INC: > /some/path/perl-5.10.0/lib/5.10.0/x86_64-linux-thread-multi > /some/path/perl-5.10.0/lib/5.10.0 > /some/path/perl-5.10.0/lib/site_perl/5.10.0/x86_64-linux-thread-multi > /some/path/perl-5.10.0/lib/site_perl/5.10.0 > . > > > --~--~---------~--~----~------------~-------~--~----~ You've received this message because you are subscribed to the Devel::NYTProf Development User group. Group hosted at: http://groups.google.com/group/develnytprof-dev Project hosted at: http://perl-devel-nytprof.googlecode.com CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf To post, email: [email protected] To unsubscribe, email: [email protected] -~----------~----~----~----~------~----~------~--~---
