[squeak-dev] #= ==> #hash issues

Chris Cunningham cunningham.cb at gmail.com
Mon Oct 29 00:34:49 UTC 2018


On Sun, Oct 28, 2018 at 2:53 PM Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

> http://bugs.squeak.org/view.php?id=3380
>

and

Intervals:
   (0 to: 1) = (0 to: 5/3). "true"
   (0 to: 1) hash = (0 to: 5/3) hash. "false"

In the inbox is collections-cbc.810.mcz, which fixes both of these bugs.

You can test them out - #hash still replicates the bugs,
while #hashBetterFastArrayCompatible (on Interval) and
#hashBetterFastIntervalCompatible (on Array) makes both work.  The later
also implements your idea of only testing some of the elements - the first
and last 16.

It slows down hash speed of Interval roughly an order of magnitude, though.

If anyone hash ideas I'd be interested. Failing that, I'll ruminate on them
for the next several days, and eventually push something in that fixes this
(meanwhile moving that package to treated).
-----
Here is the series of 'tests' that I did while working on these with
various timings.

{
[(1 to: 100 by: 1) hash] bench.
[(1 to: 100 by: 1) hashBetter] bench.
[(1 to: 100 by: 1) hashBetterAlsoFixBug3380] bench.
[(1 to: 100 by: 1) hashSlowerBetterAlsoFixBug3380] bench.
[(1 to: 100 by: 1) hashFastArrayCompatible] bench.
[(1 to: 100 by: 1) hashBetterFastArrayCompatible] bench.
'---'.
[(1 to: 100.3 by: 1) hash] bench.
[(1 to: 100.3 by: 1) hashBetter] bench.
[(1 to: 100.3 by: 1) hashBetterAlsoFixBug3380] bench.
[(1 to: 100.3 by: 1) hashSlowerBetterAlsoFixBug3380] bench.
[(1 to: 100.3 by: 1) hashFastArrayCompatible] bench.
[(1 to: 100.3 by: 1) hashBetterFastArrayCompatible] bench.
}

{
(0 to: 1) = (0 to: 5/3).
(0 to: 1) hash = (0 to: 5/3) hash.
(0 to: 1) hashBetter = (0 to: 5/3) hashBetter.
(0 to: 1) hashBetterAlsoFixBug3380 = (0 to: 5/3) hashBetterAlsoFixBug3380.
(0 to: 1) hashSlowerBetterAlsoFixBug3380 = (0 to: 5/3)
hashSlowerBetterAlsoFixBug3380.
(0 to: 1) hashFastArrayCompatible = (0 to: 5/3) hashFastArrayCompatible.
(0 to: 1) hashBetterFastArrayCompatible = (0 to: 5/3)
hashBetterFastArrayCompatible.
}


{
(1 to: 3) = #(1 2 3).
(1 to: 3) hash = #(1 2 3) hash.
(1 to: 3) hashBetter = #(1 2 3) hash.
(1 to: 3) hashBetterAlsoFixBug3380 = #(1 2 3) hash.
(1 to: 3) hashSlowerBetterAlsoFixBug3380 = #(1 2 3) hash.
(1 to: 3) hashFastArrayCompatible = #(1 2 3) hashFastIntervalCompatible.
(1 to: 3) hashBetterFastArrayCompatible = #(1 2 3)
hashBetterFastIntervalCompatible.
}

-cbc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181028/f582732e/attachment.html>


More information about the Squeak-dev mailing list