unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: larsi@gnus.org, 44471@debbugs.gnu.org
Subject: bug#44471: [PATCH] Simplify text-quoting-style
Date: Wed, 11 Nov 2020 21:24:46 +0200	[thread overview]
Message-ID: <83y2j7zog1.fsf@gnu.org> (raw)
In-Reply-To: <CADwFkm=Abfp=Sjbhofjbx3H7AFg4NStvf5gj65MNOjjF8ZPHVw@mail.gmail.com> (message from Stefan Kangas on Wed, 11 Nov 2020 14:12:24 -0500)

> From: Stefan Kangas <stefan@marxist.se>
> Date: Wed, 11 Nov 2020 14:12:24 -0500
> Cc: larsi@gnus.org, 44471@debbugs.gnu.org
> 
> >   . it slows down code of two very popular functions, because we now
> >     use EQ instead of a C-level equality operator;
> 
> If I understand correctly, EQ(x, y) ends up in a C-level equality
> operator and a typecast.  Is that correct?

No.  EQ either expands to a call to lisp_h_EQ, or calls lisp_h_EQ,
which does:

  #define lisp_h_EQ(x, y) (XLI (x) == XLI (y))

Depending on how Lisp_Object is represented, this could be a typecast
or an access to a struct member.

> If yes, is it the typecast
> that you think will cause a slowdown, or is it something else?

the function call and the struct access.

> I naively thought that this would not make much of a difference, and
> that, to the extent that it did, the relevant functions are hardly
> called often enough to matter in the end.

The difference is very minor, but the point is that it's a (minor)
disadvantage.

> >   . it introduces a function that has the same name as a variable,
> >     which adds a bit to confusion, and also defeats our method of
> >     reporting in what version was the function/variable introduced
> >     (try "C-h f"); and
> 
> This is not without precedent, see e.g. `user-full-name'.  But if we
> want to keep my patch we could of course just use the previous name
> `get-text-style' instead.
> 
> >   . I don't think I see the simplification that justifies these
> >     (admittedly quite minor) downsides
> 
> I agree it is minor, but I see one function less, one less enum, and
> overall fewer lines of code.
> 
> I'm happy to revert it if the change is not wanted.

I don't have strong opinions, so I will leave it to you and others.

My point, though, is that minor cleanups should preferably not have
adverse effects, otherwise their benefit is questionable.





      reply	other threads:[~2020-11-11 19:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 16:18 bug#44471: [PATCH] Simplify text-quoting-style Stefan Kangas
2020-11-09 15:56 ` Lars Ingebrigtsen
2020-11-09 20:13   ` Stefan Kangas
2020-11-10 14:30     ` Lars Ingebrigtsen
2020-11-10 16:12     ` Eli Zaretskii
2020-11-11 19:12       ` Stefan Kangas
2020-11-11 19:24         ` Eli Zaretskii [this message]

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=83y2j7zog1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=44471@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    /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).