From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Optimize glyph row clearing and copying routines Date: Tue, 24 Sep 2013 21:32:35 +0300 Message-ID: <83txhagjek.fsf@gnu.org> References: <83a9j2iv6o.fsf@gnu.org> <83wqm6gnhv.fsf@gnu.org> <5241D3F4.7060407@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1380047556 1509 80.91.229.3 (24 Sep 2013 18:32:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Sep 2013 18:32:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 24 20:32:38 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VOXPZ-0004Qk-Kv for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2013 20:32:37 +0200 Original-Received: from localhost ([::1]:47469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOXPZ-00044d-6P for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2013 14:32:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOXPQ-00044N-US for emacs-devel@gnu.org; Tue, 24 Sep 2013 14:32:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOXPL-000537-38 for emacs-devel@gnu.org; Tue, 24 Sep 2013 14:32:28 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:33316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOXPK-00051r-L7 for emacs-devel@gnu.org; Tue, 24 Sep 2013 14:32:22 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MTN006007E4M800@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Tue, 24 Sep 2013 21:32:21 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MTN006LP7HWFS70@a-mtaout22.012.net.il>; Tue, 24 Sep 2013 21:32:21 +0300 (IDT) In-reply-to: <5241D3F4.7060407@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163620 Archived-At: > Date: Tue, 24 Sep 2013 11:03:32 -0700 > From: Paul Eggert > > 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.