[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making 'eq' == 'eql' in bignum branch

From: Stefan Monnier
Subject: Re: Making 'eq' == 'eql' in bignum branch
Date: Sat, 28 Jul 2018 10:26:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> suffers only a 2.3% slowdown, better than the 4% slowdown Stefan mentioned
> with his simpler patch.

I'm afraid you might be comparing apples and pears, since the relative
cost may vary substantially depending on the CPU's architecture.
Have you tried to measure the slowdown of my patch on your machine?

> Stefan, have you thought about hashing floating-point objects instead, so
> that comparing pointers suffices for eql, and eq becomes equivalent to eql
> in a different way?

No I have not considered this trade-off carefully.  It's true that
floats aren't used very often, but it would make floats enormously more
expensive both in CPU and memory resources.  Currently, they cost
8 bytes of allocated heap, and currently our hash-tables cost about
6 words per entry (i.e. 48 bytes per entry on 64bit systems).
Clearly we could cut that down for hash-consing uses (where key==value),
but it's still pretty bad.

> I still see a problem there in your simpler patch, since cmpfn_eql isn't
> used in the eq case, when hashing floating-point values.

Good spotting, thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]