Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] reimplement $^WIN32_SLOPPY_STAT as a magic var #14988

Closed
p5pRT opened this issue Oct 16, 2015 · 9 comments
Closed

[PATCH] reimplement $^WIN32_SLOPPY_STAT as a magic var #14988

p5pRT opened this issue Oct 16, 2015 · 9 comments
Labels

Comments

@p5pRT
Copy link

p5pRT commented Oct 16, 2015

Migrated from rt.perl.org#126373 (status was 'resolved')

Searchable as RT126373$

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2015

From @bulk88

See attached patch.

syscall log of before sloppy stat set by default for miniperl from C

11​:46​:31.8824825 PM miniperl.exe 4124 CreateFile C​:\p521\src\lib\buildcustomize.pl SUCCESS Desired Access​: Read Attributes, Synchronize, Disposition​: Open, Options​: Synchronous IO Non-Alert, Non-Directory File, Attributes​: n/a, ShareMode​: None, AllocationSize​: n/a, OpenResult​: Opened
11​:46​:31.8825217 PM miniperl.exe 4124 QueryInformationVolume C​:\p521\src\lib\buildcustomize.pl SUCCESS VolumeCreationTime​: 4/3/2015 7​:53​:02 AM, VolumeSerialNumber​: 50BE-6406, SupportsObjects​: True, VolumeLabel​:
11​:46​:31.8825348 PM miniperl.exe 4124 QueryAllInformationFile C​:\p521\src\lib\buildcustomize.pl BUFFER OVERFLOW CreationTime​: 10/15/2015 10​:24​:54 PM, LastAccessTime​: 10/15/2015 10​:24​:54 PM, LastWriteTime​: 10/15/2015 10​:37​:00 PM, ChangeTime​: 10/15/2015 10​:37​:00 PM, FileAttributes​: A, AllocationSize​: 4,096, EndOfFile​: 1,237, NumberOfLinks​: 1, DeletePending​: False, Directory​: False, IndexNumber​: 0xb000000043896, EaSize​: 0, Access​: Read Attributes, Synchronize, Position​: 0, Mode​: Synchronous IO Non-Alert, AlignmentRequirement​: Word
11​:46​:31.8825489 PM miniperl.exe 4124 CloseFile C​:\p521\src\lib\buildcustomize.pl SUCCESS
11​:46​:31.8827111 PM miniperl.exe 4124 CreateFile C​:\p521\src\lib SUCCESS Desired Access​: Read Data/List Directory, Synchronize, Disposition​: Open, Options​: Directory, Synchronous IO Non-Alert, Attributes​: n/a, ShareMode​: Read, Write, Delete, AllocationSize​: n/a, OpenResult​: Opened
11​:46​:31.8827370 PM miniperl.exe 4124 QueryDirectory C​:\p521\src\lib\buildcustomize.pl SUCCESS Filter​: buildcustomize.pl, 1​: buildcustomize.pl
11​:46​:31.8857731 PM miniperl.exe 4124 CloseFile C​:\p521\src\lib SUCCESS
11​:46​:31.8858781 PM miniperl.exe 4124 CreateFile C​:\p521\src\lib\lib\buildcustomize.pl PATH NOT FOUND Desired Access​: Generic Read, Disposition​: Open, Options​: Synchronous IO Non-Alert, Non-Directory File, Attributes​: N, ShareMode​: Read, Write, AllocationSize​: n/
11​:46​:31.8860306 PM miniperl.exe 4124 CreateFile C​:\p521\src\lib\buildcustomize.pl SUCCESS Desired Access​: Generic Read, Disposition​: Open, Options​: Synchronous IO Non-Alert, Non-Directory File, Attributes​: N, ShareMode​: Read, Write, AllocationSize​: n/a, OpenResult​: Opened
11​:46​:31.8860653 PM miniperl.exe 4124 QueryInformationVolume C​:\p521\src\lib\buildcustomize.pl SUCCESS VolumeCreationTime​: 4/3/2015 7​:53​:02 AM, VolumeSerialNumber​: 50BE-6406, SupportsObjects​: True, VolumeLabel​:
11​:46​:31.8860776 PM miniperl.exe 4124 QueryAllInformationFile C​:\p521\src\lib\buildcustomize.pl BUFFER OVERFLOW CreationTime​: 10/15/2015 10​:24​:54 PM, LastAccessTime​: 10/15/2015 10​:24​:54 PM, LastWriteTime​: 10/15/2015 10​:37​:00 PM, ChangeTime​: 10/15/2015 10​:37​:00 PM, FileAttributes​: A, AllocationSize​: 4,096, EndOfFile​: 1,237, NumberOfLinks​: 1, DeletePending​: False, Directory​: False, IndexNumber​: 0xb000000043896, EaSize​: 0, Access​: Generic Read, Position​: 0, Mode​: Synchronous IO Non-Alert, AlignmentRequirement​: Word
11​:46​:31.8865201 PM miniperl.exe 4124 ReadFile C​:\p521\src\lib\buildcustomize.pl SUCCESS Offset​: 0, Length​: 1,237, Priority​: Normal
11​:46​:31.8866726 PM miniperl.exe 4124 CloseFile C​:\p521\src\lib\buildcustomize.pl SUCCESS

after

1​:27​:41.6000347 AM miniperl.exe 4584 CreateFile C​:\p521\src\lib SUCCESS Desired Access​: Read Data/List Directory, Synchronize, Disposition​: Open, Options​: Directory, Synchronous IO Non-Alert, Attributes​: n/a, ShareMode​: Read, Write, Delete, AllocationSize​: n/a, OpenResult​: Opened
1​:27​:41.6000729 AM miniperl.exe 4584 QueryDirectory C​:\p521\src\lib\buildcustomize.pl SUCCESS Filter​: buildcustomize.pl, 1​: buildcustomize.pl
1​:27​:41.6017876 AM miniperl.exe 4584 CloseFile C​:\p521\src\lib SUCCESS
1​:27​:41.6019467 AM miniperl.exe 4584 CreateFile C​:\p521\src\lib\buildcustomize.pl SUCCESS Desired Access​: Generic Read, Disposition​: Open, Options​: Synchronous IO Non-Alert, Non-Directory File, Attributes​: N, ShareMode​: Read, Write, AllocationSize​: n/a, OpenResult​: Opened
1​:27​:41.6019836 AM miniperl.exe 4584 QueryInformationVolume C​:\p521\src\lib\buildcustomize.pl SUCCESS VolumeCreationTime​: 4/3/2015 7​:53​:02 AM, VolumeSerialNumber​: 50BE-6406, SupportsObjects​: True, VolumeLabel​:
1​:27​:41.6019968 AM miniperl.exe 4584 QueryAllInformationFile C​:\p521\src\lib\buildcustomize.pl BUFFER OVERFLOW CreationTime​: 10/15/2015 10​:24​:54 PM, LastAccessTime​: 10/15/2015 10​:24​:54 PM, LastWriteTime​: 10/16/2015 1​:25​:37 AM, ChangeTime​: 10/16/2015 1​:25​:37 AM, FileAttributes​: A, AllocationSize​: 4,096, EndOfFile​: 1,209, NumberOfLinks​: 1, DeletePending​: False, Directory​: False, IndexNumber​: 0xb000000043896, EaSize​: 0, Access​: Generic Read, Position​: 0, Mode​: Synchronous IO Non-Alert, AlignmentRequirement​: Word
1​:27​:41.6020930 AM miniperl.exe 4584 ReadFile C​:\p521\src\lib\buildcustomize.pl SUCCESS Offset​: 0, Length​: 1,209, Priority​: Normal
1​:27​:41.6022240 AM miniperl.exe 4584 CloseFile C​:\p521\src\lib\buildcustomize.pl SUCCESS

 

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2015

From @bulk88

0001-reimplement-WIN32_SLOPPY_STAT-as-a-magic-var.patch
From c8b87727e0a3605fae65ba4f0811d649667abbf0 Mon Sep 17 00:00:00 2001
From: bulk88 <bulk88@hotmail.com>
Date: Fri, 16 Oct 2015 01:42:31 -0400
Subject: [PATCH] reimplement $^WIN32_SLOPPY_STAT as a magic var

The original implementation in commit cba61fe146 was sloppy. It is named
like a special var, it is listed as a special var, but it was a regular GV.
Since nobody knows this var exists, and full stat is the default (which I
disagree with see below). There will be alot more PP and C/XS perl stat()
calls (atleast a couple to dozens or low 100s for short lived perl
processes) than reads/writes to this global scalar (rounded to 0 R/Ws)
in a Win32 perl process. So avoid the 1 usually failing GV package (hash)
lookup for each PP/XS/PL C stat by using magic vars and a C bool. This is
a perf increase. Use sv_true instead of SvTRUE_NN because this code is
extremely rare to execute and the macro has large machine code.

I disagree with the default being full stat with since this increases the
number of kernel IO calls and ASCII->UTF16 conversions, and there was
perf criticism in the original thread that implemented this
this http://www.nntp.perl.org/group/perl.perl5.porters/2006/02/msg109917.html
but why full stat is default is for another ticket. This patch lessens the
overhead of full stat until something else is decided.

Change the initial value of the sloppystat setting for miniperl to be true
instead of doing it in buildcustomize.pl in PP. Revert part of
commit 8ce7a7e8b0 "speed up miniperl require on Win32" to acomplish this.
Unlike Unix perl, no object files are shared between mini and full perl,
so changing the default is fine on Win32 Perl. If minitest/miniperl really
need hard link testing/support, they can explictly turn off sloppy stat
and enable full stat with the special var. Changing the stat default from
C for miniperl avoids creating the special GV on each miniperl process
start as it previously was with the buildcustomize.pl way.

Changing stat setting in C and not PP also saves a couple IO calls in
win32_stat when opening the first .pl if it isn't -e, and
opening buildcustomize.pl in all permutations. The PP code in S_parse_body
contains a -f. See ticket for this patch for details.

Only CPAN use of this special var is
File-Stat-Moose-0.06/lib/File/Stat/Moose.pm#L208  according to cpangrep.
---
 gv.c                    |  4 ++++
 mg.c                    | 10 ++++++++++
 pod/perldelta.pod       | 13 +++++++++++++
 win32/win32.c           | 12 +++++++-----
 win32/win32.h           |  2 ++
 write_buildcustomize.pl |  1 -
 6 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/gv.c b/gv.c
index e82f18d..0283b2d 100644
--- a/gv.c
+++ b/gv.c
@@ -1975,6 +1975,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
 	    case '\027':	/* $^WARNING_BITS */
 		if (strEQ(name2, "ARNING_BITS"))
 		    goto magicalize;
+#ifdef WIN32
+		else if (strEQ(name2, "IN32_SLOPPY_STAT"))
+		    goto magicalize;
+#endif
 		break;
 	    case '1':
 	    case '2':
diff --git a/mg.c b/mg.c
index ea39a67..0f1c314 100644
--- a/mg.c
+++ b/mg.c
@@ -1041,6 +1041,11 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
 			  *PL_compiling.cop_warnings);
 	    }
 	}
+#ifdef WIN32
+	else if (strEQ(remaining, "IN32_SLOPPY_STAT")) {
+	    sv_setiv(sv, w32_sloppystat);
+	}
+#endif
 	break;
     case '+':
 	if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
@@ -2802,6 +2807,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
 		}
 	    }
 	}
+#ifdef WIN32
+	else if (strEQ(mg->mg_ptr+1, "IN32_SLOPPY_STAT")) {
+	    w32_sloppystat = (bool)sv_true(sv);
+	}
+#endif
 	break;
     case '.':
 	if (PL_localizing) {
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index d4fd4a8..c6805e9 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -355,6 +355,19 @@ startup and changing the variable in the parent process or another process or
 editing <.bashrc> will not change the enviromental variable in other existing,
 running, processes.
 
+=item *
+
+One glob fetch was removed for each C<-X> or C<stat> call whether done from
+Perl code or internally from Perl's C code. The glob being looked up was
+C<${^WIN32_SLOPPY_STAT}> which is a special variable. This makes C<-X> and
+C<stat> slightly faster.
+
+=item *
+
+During Miniperl's process startup, during the build process, 4 to 8 IO calls
+related to the process starting C<.pl> and the C<buildcustomize.pl> file were
+removed from the code opening and executing the first 1 or 2 C<.pl> files.
+
 =back
 
 =back
diff --git a/win32/win32.c b/win32/win32.c
index a3e1754..1f6bd91 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1463,10 +1463,6 @@ win32_stat(const char *path, Stat_t *sbuf)
     int         nlink = 1;
     BOOL        expect_dir = FALSE;
 
-    GV          *gv_sloppy = gv_fetchpvs("\027IN32_SLOPPY_STAT",
-                                         GV_NOTQUAL, SVt_PV);
-    BOOL        sloppy = gv_sloppy && SvTRUE(GvSV(gv_sloppy));
-
     if (l > 1) {
 	switch(path[l - 1]) {
 	/* FindFirstFile() and stat() are buggy with a trailing
@@ -1507,7 +1503,7 @@ win32_stat(const char *path, Stat_t *sbuf)
     path = PerlDir_mapA(path);
     l = strlen(path);
 
-    if (!sloppy) {
+    if (!w32_sloppystat) {
         /* We must open & close the file once; otherwise file attribute changes  */
         /* might not yet have propagated to "other" hard links of the same file. */
         /* This also gives us an opportunity to determine the number of links.   */
@@ -4681,6 +4677,11 @@ Perl_sys_intern_init(pTHX)
     w32_timerid                 = 0;
     w32_message_hwnd            = CAST_HWND__(INVALID_HANDLE_VALUE);
     w32_poll_count              = 0;
+#ifdef PERL_IS_MINIPERL
+    w32_sloppystat              = TRUE;
+#else
+    w32_sloppystat              = FALSE;
+#endif
     for (i=0; i < SIG_SIZE; i++) {
     	w32_sighandler[i] = SIG_DFL;
     }
@@ -4748,6 +4749,7 @@ Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst)
     dst->timerid                = 0;
     dst->message_hwnd		= CAST_HWND__(INVALID_HANDLE_VALUE);
     dst->poll_count             = 0;
+    dst->sloppystat             = src->sloppystat;
     Copy(src->sigtable,dst->sigtable,SIG_SIZE,Sighandler_t);
 }
 #  endif /* USE_ITHREADS */
diff --git a/win32/win32.h b/win32/win32.h
index e997651..9b79e00 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -504,6 +504,7 @@ struct interp_intern {
     UINT	timerid;
     unsigned 	poll_count;
     Sighandler_t sigtable[SIG_SIZE];
+    bool sloppystat;
 };
 
 #define WIN32_POLL_INTERVAL 32768
@@ -537,6 +538,7 @@ struct interp_intern {
 #define w32_init_socktype	(PL_sys_intern.thr_intern.Winit_socktype)
 #define w32_use_showwindow	(PL_sys_intern.thr_intern.Wuse_showwindow)
 #define w32_showwindow	(PL_sys_intern.thr_intern.Wshowwindow)
+#define w32_sloppystat	(PL_sys_intern.sloppystat)
 
 #ifdef USE_ITHREADS
 void win32_wait_for_children(pTHX);
diff --git a/write_buildcustomize.pl b/write_buildcustomize.pl
index 68e300f..cf56e33 100644
--- a/write_buildcustomize.pl
+++ b/write_buildcustomize.pl
@@ -87,7 +87,6 @@ print $fh <<"EOT" or $error = "Can't print to $file: $!";
 # We are miniperl, building extensions
 # Replace the first entry of \@INC ("lib") with the list of
 # directories we need.
-${\($^O eq 'MSWin32' ? '${^WIN32_SLOPPY_STAT} = 1;':'')}
 splice(\@INC, 0, 1, $inc);
 \$^O = '$osname';
 __END__
-- 
1.9.5.msysgit.1

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2015

From @bulk88

On Fri Oct 16 09​:31​:03 2015, bulk88 wrote​:

See attached patch.

Fixed patch attached (wrong author name).

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2015

From @bulk88

0001-reimplement-WIN32_SLOPPY_STAT-as-a-magic-var.patch
From e6bcd7208b40570fb5747f7e5d23449612fc2e75 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Fri, 16 Oct 2015 17:49:20 -0400
Subject: [PATCH] reimplement $^WIN32_SLOPPY_STAT as a magic var

The original implementation in commit cba61fe146 was sloppy. It is named
like a special var, it is listed as a special var, but it was a regular GV.
Since nobody knows this var exists, and full stat is the default (which I
disagree with see below). There will be alot more PP and C/XS perl stat()
calls (atleast a couple to dozens or low 100s for short lived perl
processes) than reads/writes to this global scalar (rounded to 0 R/Ws)
in a Win32 perl process. So avoid the 1 usually failing GV package (hash)
lookup for each PP/XS/PL C stat by using magic vars and a C bool. This is
a perf increase. Use sv_true instead of SvTRUE_NN because this code is
extremely rare to execute and the macro has large machine code.

I disagree with the default being full stat with since this increases the
number of kernel IO calls and ASCII->UTF16 conversions, and there was
perf criticism in the original thread that implemented this
this http://www.nntp.perl.org/group/perl.perl5.porters/2006/02/msg109917.html
but why full stat is default is for another ticket. This patch lessens the
overhead of full stat until something else is decided.

Change the initial value of the sloppystat setting for miniperl to be true
instead of doing it in buildcustomize.pl in PP. Revert part of
commit 8ce7a7e8b0 "speed up miniperl require on Win32" to acomplish this.
Unlike Unix perl, no object files are shared between mini and full perl,
so changing the default is fine on Win32 Perl. If minitest/miniperl really
need hard link testing/support, they can explictly turn off sloppy stat
and enable full stat with the special var. Changing the stat default from
C for miniperl avoids creating the special GV on each miniperl process
start as it previously was with the buildcustomize.pl way.

Changing stat setting in C and not PP also saves a couple IO calls in
win32_stat when opening the first .pl if it isn't -e, and
opening buildcustomize.pl in all permutations. The PP code in S_parse_body
contains a -f. See ticket for this patch for details.

Only CPAN use of this special var is
File-Stat-Moose-0.06/lib/File/Stat/Moose.pm#L208  according to cpangrep.
---
 gv.c                    |  4 ++++
 mg.c                    | 10 ++++++++++
 pod/perldelta.pod       | 13 +++++++++++++
 win32/win32.c           | 12 +++++++-----
 win32/win32.h           |  2 ++
 write_buildcustomize.pl |  1 -
 6 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/gv.c b/gv.c
index e82f18d..0283b2d 100644
--- a/gv.c
+++ b/gv.c
@@ -1975,6 +1975,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
 	    case '\027':	/* $^WARNING_BITS */
 		if (strEQ(name2, "ARNING_BITS"))
 		    goto magicalize;
+#ifdef WIN32
+		else if (strEQ(name2, "IN32_SLOPPY_STAT"))
+		    goto magicalize;
+#endif
 		break;
 	    case '1':
 	    case '2':
diff --git a/mg.c b/mg.c
index ea39a67..0f1c314 100644
--- a/mg.c
+++ b/mg.c
@@ -1041,6 +1041,11 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
 			  *PL_compiling.cop_warnings);
 	    }
 	}
+#ifdef WIN32
+	else if (strEQ(remaining, "IN32_SLOPPY_STAT")) {
+	    sv_setiv(sv, w32_sloppystat);
+	}
+#endif
 	break;
     case '+':
 	if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
@@ -2802,6 +2807,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
 		}
 	    }
 	}
+#ifdef WIN32
+	else if (strEQ(mg->mg_ptr+1, "IN32_SLOPPY_STAT")) {
+	    w32_sloppystat = (bool)sv_true(sv);
+	}
+#endif
 	break;
     case '.':
 	if (PL_localizing) {
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index d4fd4a8..c6805e9 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -355,6 +355,19 @@ startup and changing the variable in the parent process or another process or
 editing <.bashrc> will not change the enviromental variable in other existing,
 running, processes.
 
+=item *
+
+One glob fetch was removed for each C<-X> or C<stat> call whether done from
+Perl code or internally from Perl's C code. The glob being looked up was
+C<${^WIN32_SLOPPY_STAT}> which is a special variable. This makes C<-X> and
+C<stat> slightly faster.
+
+=item *
+
+During Miniperl's process startup, during the build process, 4 to 8 IO calls
+related to the process starting C<.pl> and the C<buildcustomize.pl> file were
+removed from the code opening and executing the first 1 or 2 C<.pl> files.
+
 =back
 
 =back
diff --git a/win32/win32.c b/win32/win32.c
index a3e1754..1f6bd91 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1463,10 +1463,6 @@ win32_stat(const char *path, Stat_t *sbuf)
     int         nlink = 1;
     BOOL        expect_dir = FALSE;
 
-    GV          *gv_sloppy = gv_fetchpvs("\027IN32_SLOPPY_STAT",
-                                         GV_NOTQUAL, SVt_PV);
-    BOOL        sloppy = gv_sloppy && SvTRUE(GvSV(gv_sloppy));
-
     if (l > 1) {
 	switch(path[l - 1]) {
 	/* FindFirstFile() and stat() are buggy with a trailing
@@ -1507,7 +1503,7 @@ win32_stat(const char *path, Stat_t *sbuf)
     path = PerlDir_mapA(path);
     l = strlen(path);
 
-    if (!sloppy) {
+    if (!w32_sloppystat) {
         /* We must open & close the file once; otherwise file attribute changes  */
         /* might not yet have propagated to "other" hard links of the same file. */
         /* This also gives us an opportunity to determine the number of links.   */
@@ -4681,6 +4677,11 @@ Perl_sys_intern_init(pTHX)
     w32_timerid                 = 0;
     w32_message_hwnd            = CAST_HWND__(INVALID_HANDLE_VALUE);
     w32_poll_count              = 0;
+#ifdef PERL_IS_MINIPERL
+    w32_sloppystat              = TRUE;
+#else
+    w32_sloppystat              = FALSE;
+#endif
     for (i=0; i < SIG_SIZE; i++) {
     	w32_sighandler[i] = SIG_DFL;
     }
@@ -4748,6 +4749,7 @@ Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst)
     dst->timerid                = 0;
     dst->message_hwnd		= CAST_HWND__(INVALID_HANDLE_VALUE);
     dst->poll_count             = 0;
+    dst->sloppystat             = src->sloppystat;
     Copy(src->sigtable,dst->sigtable,SIG_SIZE,Sighandler_t);
 }
 #  endif /* USE_ITHREADS */
diff --git a/win32/win32.h b/win32/win32.h
index e997651..9b79e00 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -504,6 +504,7 @@ struct interp_intern {
     UINT	timerid;
     unsigned 	poll_count;
     Sighandler_t sigtable[SIG_SIZE];
+    bool sloppystat;
 };
 
 #define WIN32_POLL_INTERVAL 32768
@@ -537,6 +538,7 @@ struct interp_intern {
 #define w32_init_socktype	(PL_sys_intern.thr_intern.Winit_socktype)
 #define w32_use_showwindow	(PL_sys_intern.thr_intern.Wuse_showwindow)
 #define w32_showwindow	(PL_sys_intern.thr_intern.Wshowwindow)
+#define w32_sloppystat	(PL_sys_intern.sloppystat)
 
 #ifdef USE_ITHREADS
 void win32_wait_for_children(pTHX);
diff --git a/write_buildcustomize.pl b/write_buildcustomize.pl
index 68e300f..cf56e33 100644
--- a/write_buildcustomize.pl
+++ b/write_buildcustomize.pl
@@ -87,7 +87,6 @@ print $fh <<"EOT" or $error = "Can't print to $file: $!";
 # We are miniperl, building extensions
 # Replace the first entry of \@INC ("lib") with the list of
 # directories we need.
-${\($^O eq 'MSWin32' ? '${^WIN32_SLOPPY_STAT} = 1;':'')}
 splice(\@INC, 0, 1, $inc);
 \$^O = '$osname';
 __END__
-- 
1.9.5.msysgit.1

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2015

From @jkeenan

On Fri Oct 16 09​:31​:03 2015, bulk88 wrote​:

See attached patch.

syscall log of before sloppy stat set by default for miniperl from C

11​:46​:31.8824825 PM miniperl.exe 4124 CreateFile
C​:\p521\src\lib\buildcustomize.pl SUCCESS Desired Access​: Read
Attributes, Synchronize, Disposition​: Open, Options​: Synchronous IO
Non-Alert, Non-Directory File, Attributes​: n/a, ShareMode​: None,
AllocationSize​: n/a, OpenResult​: Opened
11​:46​:31.8825217 PM miniperl.exe 4124 QueryInformationVolume

[snip]

As recommended in RT #126377, could you re-format this performance data as .tsv or .csv files and attach to this RT?

Thank you very much.
Jim Keenan

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Oct 19, 2015

From @tonycoz

On Fri Oct 16 09​:31​:03 2015, bulk88 wrote​:

See attached patch.

Thanks, applied as 8ca2a5d.

Tony

@p5pRT p5pRT closed this as completed Oct 19, 2015
@p5pRT
Copy link
Author

p5pRT commented Oct 19, 2015

@tonycoz - Status changed from 'open' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Oct 19, 2015

From @demerphq

Just wanted to say thanks to you guys. Im sure if I was on Win32 these
days I would be most appreciate of this patch.

On 19 October 2015 at 06​:20, Tony Cook via RT <perlbug-followup@​perl.org> wrote​:

On Fri Oct 16 09​:31​:03 2015, bulk88 wrote​:

See attached patch.

Thanks, applied as 8ca2a5d.

Tony

---
via perlbug​: queue​: perl5 status​: open
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=126373

--
perl -Mre=debug -e "/just|another|perl|hacker/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant