unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Optimize glyph row clearing and copying routines
Date: Tue, 24 Sep 2013 21:32:35 +0300	[thread overview]
Message-ID: <83txhagjek.fsf@gnu.org> (raw)
In-Reply-To: <5241D3F4.7060407@cs.ucla.edu>

> Date: Tue, 24 Sep 2013 11:03:32 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> The new code does have an advantage of clarity.

I don't think I agree.  The new code is _simpler_, allright, but it
obfuscates the meaning:

  enum { off = offsetof (struct glyph_row, x) };

  memcpy (&to->x, &from->x, sizeof *to - off);

You will not understand what is going on, until you look up the
definition of 'struct glyph_row' (on another file), and find out that
the members mentioned in the commentary (IF you've read the
commentary) are all before 'x' in the struct layout.

In the old, all this was explicit in the source code.

> The old code squirreled away some stuff in a temporary copy
> and then copied it back, which was hard to follow,
> whereas the new code simply copies from source to
> destination.  This may be worth any minor performance loss.

I don't see any advantages either way, so I think we are talking
stylistic preferences here.  Making changes just because one doesn't
like the existing style is maintenance burden and waste of energy.  It
does have one clear disadvantage: it makes the familiar code no longer
that, and makes it harder to merge from long-living branches.

In general, I'm amazed how much of the changes lately are minor
changes due to obscure or stylistic issues, with no real gain in
functionality.



  reply	other threads:[~2013-09-24 18:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24  6:35 Optimize glyph row clearing and copying routines Eli Zaretskii
2013-09-24 10:10 ` Dmitry Antipov
2013-09-24 11:50   ` Eli Zaretskii
2013-09-24 12:42     ` Dmitry Antipov
2013-09-24 13:40 ` John Yates
2013-09-24 17:04   ` Eli Zaretskii
2013-09-24 17:28     ` John Yates
2013-09-24 18:03     ` Paul Eggert
2013-09-24 18:32       ` Eli Zaretskii [this message]
2013-09-26 12:35         ` Juanma Barranquero

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=83txhagjek.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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).