diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-09-30 05:28:54 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-10-12 09:13:30 +1100 |
commit | 0517ed3816767f5896256870b8cca4b856e4088a (patch) | |
tree | 93a58f3853c0cc3f9cffaf11ea173548ffef767b /README.win32 | |
parent | 88738d823fb3f072e9d615472f9d2dbe13456154 (diff) | |
download | perl-0517ed3816767f5896256870b8cca4b856e4088a.tar.gz |
stop checking the Win32 registry if *"/Software/Perl" doesn't exist
This stops each ENV var lookup (and 16 calls to get_regstr, most of which
are %ENV lookups, are done automatically each time a Win32 Perl process
starts) from querying the registry for usually failing lookups.
ActiveState is the only known major user of the Software/Perl reg key.
details:
-cache the root handles, so a typically failing env var lookup does only 1
system call instead of 3 if the parent key exists
-if the key exists, looking it up is slightly faster since it is 4
registry syscall instead of previously 6 (open "*\Software\Perl", 2
RegQueryValueExAs(on "found" behavior each RegQueryValueExA does 2
RegQueryValueExW calls), close "*\Software\Perl")
-dont make a system call to lookup a value if the parent key doesn't exist
-change "Software\\Perl" to "SOFTWARE\\Perl" since the reg is case
preserving but lookups are not case sensitive, this all caps casing is
what regedit shows, and might save a couple cpu cycles in the DB lookup
in the kernel
-use RegOpenKeyExW instead of RegOpenKeyEx (actually RegOpenKeyExA), this
avoids ansi to utf16 conversions at runtime
-dont check HKEY handles for NULL before calling RegCloseKey.
MS and ReactOS RegCloseKey checks for NULL (zero) handle first thing and
returns ERROR_INVALID_HANDLE as the retval of RegCloseKey. MS App Verifier
does not complain about NULL handles.
-Dont check the retval of RegCloseKey, there is no way to dispatch an error
at this point in the process, there are no interps, and no perlio, and
maybe no console if its a GUI, and the process is probably exiting anyway.
Calling Perl_noperl_die (no perl, no perlio, print to stderr) would not
be friendly to an embedder. A crash box with RaiseException with
EXCEPTION_INVALID_HANDLE is a bad UI.
-Dont bother to zero the HKEY handles, after a PERL_SYS_TERM until the
next (if any) PERL_SYS_INIT3, libperl is in an undefined state, it is the
embedders responsibility to refcount and serialize calls to
PERL_SYS_INIT3/PERL_SYS_TERM if necessary
See details in [perl #123658]
Diffstat (limited to 'README.win32')
-rw-r--r-- | README.win32 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/README.win32 b/README.win32 index 2a8651a0c6..7e6565387e 100644 --- a/README.win32 +++ b/README.win32 @@ -485,10 +485,13 @@ You can also control the shell that perl uses to run system() and backtick commands via PERL5SHELL. See L<perlrun>. Perl does not depend on the registry, but it can look up certain default -values if you choose to put them there. Perl attempts to read entries from -C<HKEY_CURRENT_USER\Software\Perl> and C<HKEY_LOCAL_MACHINE\Software\Perl>. -Entries in the former override entries in the latter. One or more of the -following entries (of type REG_SZ or REG_EXPAND_SZ) may be set: +values if you choose to put them there. On Perl process start Perl checks if +C<HKEY_CURRENT_USER\Software\Perl> and C<HKEY_LOCAL_MACHINE\Software\Perl> +exist. If the keys exists, they will be checked for remainder of the Perl +process's run life for certain entries. Entries in +C<HKEY_CURRENT_USER\Software\Perl> override entries in +C<HKEY_LOCAL_MACHINE\Software\Perl>. One or more of the following entries +(of type REG_SZ or REG_EXPAND_SZ) may be set in the keys: lib-$] version-specific standard library path to add to @INC lib standard library path to add to @INC |