unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches
Date: Thu, 23 Aug 2018 14:55:31 +0000	[thread overview]
Message-ID: <CAOqdjBfrhxeH80xaR94GcrJLN5Hzw_ow3AgL1jWUwJqNbkUjWA@mail.gmail.com> (raw)
In-Reply-To: <jwvbm9ui14p.fsf-monnier+gmane.emacs.devel@gnu.org>

Hello, Stefan.

On Wed, Aug 22, 2018 at 8:46 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > As for `eq' and `eql', what I thought Stefan proposed was to keep a
> > hash value in struct Lisp_Bignum, which is calculated lazily the first
> > time the bignum is compared to another bignum with `eq', at which
> > point we might as well point out to the user that portable code would
> > require `eql'. That sounds to me like it would be much cheaper than a
> > hash table, but if there are objections to it we can still implement
> > it without guaranteeing it for the future in the documentation.
>
> No, that's definitely not what I was proposing.  I was proposing an
> actual hash-table.

I'm sorry, I totally misread what you wrote. No, you weren't proposing
anything like that.

> What you're suggesting is problematic in that it
> assumes `eq` will do something special for bignums, which implies `eq`
> is not just `==` in C.

Well, it isn't `==' if we're building with
--enable-check-lisp-object-type, so the problems would be memcmp or
hashing memory that might contain Lisp_Objects. I'm not aware of any
places that do either of those.

I've got something running and things appear not to fail
catastrophically right away, at least, with EQ changed to include an
extra condition for "overloaded" objects. Assuming some compiler
smarts, NILP wouldn't suffer, and EQ wouldn't suffer if one side is
known to have a normal type. I doubt the performance hit will be
measurable; if anything, the if-fixnum-do-this-if-bignum-do-that code
we have right now might be worse for caches than making the bignum
code a cold function.



  reply	other threads:[~2018-08-23 14:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180821204437.16880.99611@vcs0.savannah.gnu.org>
     [not found] ` <20180821204439.62390209A6@vcs0.savannah.gnu.org>
2018-08-22 12:36   ` [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches Pip Cet
2018-08-22 13:35     ` Ken Brown
2018-08-22 13:44       ` Paul Eggert
2018-08-22 15:50         ` Pip Cet
2018-08-22 17:27           ` Paul Eggert
2018-08-22 20:05             ` Pip Cet
2018-08-22 21:53               ` Paul Eggert
2018-08-22 20:45           ` Stefan Monnier
2018-08-23 14:55             ` Pip Cet [this message]
2018-08-23 15:56               ` Stefan Monnier
2018-08-24 18:00                 ` Pip Cet
2018-08-24 20:55                   ` Paul Eggert
2018-08-25 15:02                     ` Pip Cet
2018-08-25 18:02                       ` Stefan Monnier
2018-08-25 21:24                       ` Paul Eggert
2018-08-28 14:08                 ` hash-consing bignums and eq==eql Stefan Monnier
2018-08-29 13:32                   ` Pip Cet
2018-08-29 19:23                     ` Stefan Monnier
2018-08-29 19:31                     ` Paul Eggert
2018-08-29 20:50                       ` Stefan Monnier
2018-09-09  3:09                       ` Stefan Monnier
2018-09-09  6:26                         ` Paul Eggert
2018-08-22 13:49       ` [Emacs-diffs] master f18af6c: Audit use of lsh and fix glitches Pip Cet
2018-08-22 14:52         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOqdjBfrhxeH80xaR94GcrJLN5Hzw_ow3AgL1jWUwJqNbkUjWA@mail.gmail.com \
    --to=pipcet@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).