[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.
Stefan
- Re: Using the GNU GMP Library for Bignums in Emacs, (continued)
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/07/11
- Re: Using the GNU GMP Library for Bignums in Emacs, Tom Tromey, 2018/07/12
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/07/12
- Re: Using the GNU GMP Library for Bignums in Emacs, Stefan Monnier, 2018/07/15
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/07/18
- Re: Using the GNU GMP Library for Bignums in Emacs, Stefan Monnier, 2018/07/18
- Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/27
- Re: Making 'eq' == 'eql' in bignum branch,
Stefan Monnier <=
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/28
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/07/29
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/29
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/31
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/31