| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
so that hv_func is left with only logic relating to selecting
and configuring the hash function we use, not the macros our
hash functions use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for three new hash functions: StadtX, Zaphod32 and SBOX,
and reworks some of our hash internals infrastructure to do so.
SBOX is special in that it is designed to be used in conjuction with any
other hash function for hashing short strings very efficiently and very
securely. It features compile time options on how much memory and startup
time are traded off to control the length of keys that SBOX hashes.
This also adds support for caching the hash values of single byte characters
which can be used in conjuction with any other hash, including SBOX, although
SBOX itself is as fast as the lookup cache, so typically you wouldnt use both
at the same time.
This also *removes* support for Jenkins One-At-A-Time. It has served us
well, but it's day is done.
This patch adds three new files: zaphod32_hash.h, stadtx_hash.h,
sbox32_hash.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this patch we resized hashes when after inserting a key
the load factor of the hash reached 1 (load factor= keys / buckets).
This patch makes two subtle changes to this logic:
1. We split only after inserting a key into an utilized bucket,
2. and the maximum load factor exceeds 0.667
The intent and effect of this change is to increase our hash tables
efficiency. Reducing the maximum load factor 0.667 means that we should
have much less keys in collision overall, at the cost of some unutilized
space (2/3rds was chosen as it is easier to calculate than 0.7). On the
other hand, only splitting after a collision means in theory that we execute
the "final split" less often. Additionally, insertin a key into an unused
bucket increases the efficiency of the hash, without changing the worst
case.[1] In other words without increasing collisions we use the space
in our hashes more efficiently.
A side effect of this hash is that the size of a hash is more sensitive
to key insert order. A set of keys with some collisions might be one
size if those collisions were encountered early, or another if they were
encountered later. Assuming random distribution of hash values about
50% of hashes should be smaller than they would be without this rule.
The two changes complement each other, as changing the maximum load
factor decreases the chance of a collision, but changing to only split
after a collision means that we won't waste as much of that space we
might.
[1] Since I personally didnt find this obvious at first here is my
explanation:
The old behavior was that we doubled the number of buckets when the
number of keys in the hash matched that of buckets. So on inserting
the Kth key into a K bucket hash, we would double the number of
buckets. Thus the worse case prior to this patch was a hash
containing K-1 keys which all hash into a single bucket, and the post
split worst case behavior would be having K items in a single bucket
of a hash with 2*K buckets total.
The new behavior says that we double the size of the hash once inserting
an item into an occupied bucket and after doing so we exceeed the maximum
load factor (leave aside the change in maximum load factor in this patch).
If we insert into an occupied bucket (including the worse case bucket) then
we trigger a key split, and we have exactly the same cases as before.
If we insert into an empty bucket then we now have a worst case of K-1 items
in one bucket, and 1 item in another, in a hash with K buckets, thus the
worst case has not changed.
|
| |
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RT #131098
This branch fixes two issues with the message produced when
require croaks.
First it mentioned @INC even when @INC wasn't scanned, and second it
emitted the "you may need to install Foo::Bar module" hint even when the
failed-to-load pathname wasn't reverse-mappable to a module name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RT #131098
The helpful "you may need to install" hint which 'require' sometimes
includes in its error message these days (split across multiple lines for
clarity):
$ perl -e'require Foo::Bar'
Can't locate Foo/Bar.pm in @INC
(you may need to install the Foo::Bar module)
(@INC contains: ... ) at ...
is a bit over-enthusiastic when the pathname hasn't actually been derived
from a module name:
$ perl -e'require "Foo.+/%#Bar.pm"'
Can't locate Foo.+%#Bar.pm in @INC
(you may need to install the Foo.+::%#Bar module)
(@INC contains: ... ) at ...
This commit changes things so that the hint message is only emitted if the
reverse-mapped module name is legal as a bareword:
$ perl -e'require "Foo.+/%#Bar.pm"'
Can't locate Foo.+%#Bar.pm in @INC
(@INC contains: ... ) at ...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RT #131098
5.8.0 introduced a change which as an inadvertent side-effect caused
this @INC-related require croak message:
Can't locate foo in @INC (@INC contains: ...) at ...
to be emitted even when foo is a non-searchable pathname (like /foo or
./foo) and @INC isn't used.
This commit reverts the error message in these cases to be the simple
Can't locate foo at ...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
change
if (...) {
...
}
else {
if (...) {
...
}
}
to
if (...) {
...
}
else if (...) {
...
}
Should make no functional difference
|
|/
|
|
|
| |
Add code more comments to S_require_file() and its helpder functions to
better understand what's going on.
|
|
|
|
|
|
|
| |
With v5.25.11-59-g7335cb8 I added an include guard. PERL_UTIL_H_,
but added it to util.c rather than util.h.
I am not a smart man....
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See [perl #130497]
GNU Autoconf depends on Perl, and will not work on Blead (and the
forthcoming Perl 5.26), due to a single unescaped '{', that has
previously been deprecated and is now fatal. A patch for it has been in
the Autoconf repository since early 2013, but there has not been a
release since before then.
Because this is depended on by so much code, and because it is simpler
than trying to revert to making the fatality merely deprecated, this
patch simply changes perl to not die when compiled with the exact
pattern that trips up Autoconf. Thus Autoconf can continue to work, but
any other patterns that use the now illegal construct will continue to
die. If other code uses the exact pattern, they too will not die, but
the deprecation message continues to get raised. The use of the left
brace in this particular pattern is not one where we envision using the
construct to mean something else, so a deprecation is suitable for the
foreseeable future.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
RT #131141
CPAN-2.17-TRIAL tried to narrow the scope to the phases prepare, make,
and test, but after some testing evidence took shape that
PERL_USE_UNSAFE_INC=1 is also needed for the install phase.
2.18 provides this change. The second issue fixed in 2.18 addresses
RT #120781, an ugly bug with a trivial fix.
|
|
|
|
|
|
| |
see RT #131110 for the bikeshedding on what name to use.
Based on an original patch by Jim Schneider
|
|
|
|
|
|
|
|
|
|
| |
RT #131124
In a couple of places in shared.xs, it calls sv_newmortal() with
a perl context different from that currently set by PERL_SET_CONTEXT().
If sv_newmortal() happens to trigger the malloc of a new SV HEAD arena,
then under PERL_TRACK_MEMPOOL, this will cause panics when the arena is
freed or realloced.
|
|
|
|
| |
Its an enabled-by-default deprecation warning
|
|
|
|
| |
Make it clear that both ./ and ../ are special-cased.
|
| |
|
|
|
|
| |
[The committer made a few changes for improved readability]
|
| |
|
|
|
|
|
| |
A BOM at the beginning of a UTF-8 file is ignored, and doesn't otherwise
do anything.
|
| |
|
|\
| |
| |
| |
| |
| | |
Update TestInuit.pm etc so that tests are no longer invoked with
'.' in @INC. Then fix up all the tests that break because of this.
Then fix up some bad usage of 'do' that's not detected by tests.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
During the build of XS modules, an empty Foo.bs file is normally created
for each Foo.so file. If a Foo_BS file is present, instead this triggers
the auto-generatation of a .bs file which may have executable perl
content.
However, nothing in core currently generates a non-empty .bs file. So add
a test that this mechanism works, and fix up the three dynamic lib loaders
which implement the 'do $bs if -s $bs' mechanism to not rely on the
process having '.' present in @INC.
As it happens this already works currently, because the name of the
.bs file to load will usually be something like
../../lib/auto/Foo/Foo.bs
and the presence of the leading '..' causes 'do' to load the file directly
rather than via @INC. But locally fix up @INC anyway, in case '../' isn't
always the case.
|
| |
| |
| |
| |
| |
| | |
It 'do's a file in the current directory, which fails without '.' in @INC.
This doesn't matter in core at the moment, but CPAN releases should be
fixed.
|
| |
| |
| |
| |
| |
| | |
These are some cases which weren't picked up by the test suite
[ This is a subset of a set of fixes originally submitted by James as
2 commits - DAPM]
|