Skip Menu |
Report information
Id: 123633
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: bulk88 <bulk88 [at] hotmail.com>
Cc:
AdminCc:

Operating System: mswin32
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.21.4
Fixed In: (no value)

Attachments
0001-factor-out-an-ENV-assignment-from-make_ext.pl.patch



Date: Tue, 20 Jan 2015 02:47:07 -0500
Subject: [PATCH] factor out an %ENV assignment from make_ext.pl
From: bulk88 <bulk88 [...] hotmail.com>
To: perlbug [...] perl.org
Download (untitled) / with headers
text/plain 3.9k
This is a bug report for perl from bulk88@hotmail.com, generated with the help of perlbug 1.40 running under perl 5.21.4. ----------------------------------------------------------------- [Please describe your issue here] See attached patch. Half a ms savings is very low, but it was the easiest thing to improve. For make_ext.pl, outside of system()/``, regexps are the next biggest class of time, the file test operators come after that. ("-d" is 4 Win32 kernel calls (opendir/FindFirstFile readdir/FindNextFile close/CloseHandle stat/GetFileAttributes) instead of 1 kernel call(stat/GetFileAttributes). [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.21.4: Configured by Owner at Thu Sep 18 12:08:58 2014. Summary of my perl5 (revision 5 version 21 subversion 4) configuration: Derived from: 7d2b2edb94ab56333b9049a3e26d15ea18445512 Ancestor: 19be3be6968e2337bcdfe480693fff795ecd1304 Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DPERL_HASH_FUNC_ONE_AT_A_TIME -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T', optimize='-O1 -MD -Zi -DNDEBUG', cppflags='-DWIN32' ccversion='12.00.8168', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl521\lib\CORE" -machine:x86' libpth=C:\PROGRA~1\MIAF9D~1\VC98\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl521.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"c:\perl521\lib\CORE" -machine:x86' Locally applied patches: uncommitted-changes a0fe7a7e75de29e59f1da0d6822dc06e5be658fe a261faffee83d0145642ab5d1d046c9f813bc497 6506ab86ad1602a9ca720fcd30446dce1461d23d 7d2b2edb94ab56333b9049a3e26d15ea18445512 --- @INC for perl 5.21.4: lib C:/perl521/srcnew/lib . --- Environment for perl 5.21.4: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH= PERL_BADLANG (unset) PERL_JSON_BACKEND=Cpanel::JSON::XS PERL_YAML_BACKEND=YAML SHELL (unset)
From be402a4d441c92abe21fc071197eac4b02d4d4a6 Mon Sep 17 00:00:00 2001 From: Daniel Dragan <bulk88@hotmail.com> Date: Tue, 20 Jan 2015 01:25:26 -0500 Subject: [PATCH] factor out an %ENV assignment from make_ext.pl nytprof using full (not mini) Win32 perl reported 44 calls on line "$ENV{PERL_CORE} = 1;" at 623 us spent on line for make_ext.pl --dynamic Move the env var setting out from build_extension() to before the foreach loop starts. --- make_ext.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/make_ext.pl b/make_ext.pl index ca81c86..2755955 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -220,6 +220,7 @@ if ($Config{osname} eq 'catamount' and @extspec) { # Snowball's chance of building extensions. die "This is $Config{osname}, not building $extspec[0], sorry.\n"; } +$ENV{PERL_CORE} = 1; foreach my $spec (@extspec) { my $mname = $spec; @@ -333,7 +334,6 @@ sub build_extension { $perl ||= "$up/miniperl"; my $return_dir = $up; my $lib_dir = "$up/lib"; - $ENV{PERL_CORE} = 1; my ($makefile, $makefile_no_minus_f); if (IS_VMS) { -- 1.7.9.msysgit.0
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 818b
On Mon Jan 19 23:48:49 2015, bulk88 wrote: Show quoted text
> This is a bug report for perl from bulk88@hotmail.com, > generated with the help of perlbug 1.40 running under perl 5.21.4. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > See attached patch. Half a ms savings is very low, but it was the > easiest thing to improve. For make_ext.pl, outside of system()/``, > regexps are the next biggest class of time, the file test operators come > after that. ("-d" is 4 Win32 kernel calls (opendir/FindFirstFile > readdir/FindNextFile close/CloseHandle stat/GetFileAttributes) instead > of 1 kernel call(stat/GetFileAttributes). >
Can you provide the exact perl program you used with Devel::NYTProf? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On Mon Jan 26 19:10:35 2015, jkeenan wrote: Show quoted text
> On Mon Jan 19 23:48:49 2015, bulk88 wrote:
> > This is a bug report for perl from bulk88@hotmail.com, > > generated with the help of perlbug 1.40 running under perl 5.21.4. > > > > > > ----------------------------------------------------------------- > > [Please describe your issue here] > > > > See attached patch. Half a ms savings is very low, but it was the > > easiest thing to improve. For make_ext.pl, outside of system()/``, > > regexps are the next biggest class of time, the file test operators come > > after that. ("-d" is 4 Win32 kernel calls (opendir/FindFirstFile > > readdir/FindNextFile close/CloseHandle stat/GetFileAttributes) instead > > of 1 kernel call(stat/GetFileAttributes). > >
> > Can you provide the exact perl program you used with Devel::NYTProf? > > Thank you very much. >
C:\perl521\src\win32>C:\perl521\bin\perl.exe -d:NYTProf -I..\lib ..\make_ext.pl "MAKE=nmake -nologo" --dir=..\cpan --dir=..\dist --dir=..\ext --dynamic I didn't fake the no dynaloader scenario of miniperl, but I wasn't interested in the performance of anything but the file make_ext.pl. EUMM on win32 shells out instead of using XS modules in a couple places with miniperl for example. -- bulk88 ~ bulk88 at hotmail.com
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 512b
On Mon Jan 19 23:48:49 2015, bulk88 wrote: Show quoted text
> See attached patch. Half a ms savings is very low, but it was the > easiest thing to improve. For make_ext.pl, outside of system()/``, > regexps are the next biggest class of time, the file test operators come > after that. ("-d" is 4 Win32 kernel calls (opendir/FindFirstFile > readdir/FindNextFile close/CloseHandle stat/GetFileAttributes) instead > of 1 kernel call(stat/GetFileAttributes).
Thanks, applied as 31221351abb3a508c369e8203d17da077adc667b. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org