[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Remove display member of glyph_string

From: Alex Gramiak
Subject: Re: [PATCH] Remove display member of glyph_string
Date: Thu, 09 May 2019 10:07:25 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Alex Gramiak <address@hidden>
>> Date: Wed, 08 May 2019 21:52:56 -0600
> Each FRAME_X_DISPLAY call expands into applying a struct offset 4
> times.  Do we care about the (small) additional inefficiency?  AFAIU,
> that was the cause for maintaining the result inside the glyph_string
> structure in the first place.

I doubt that it's much of a difference. However, it should be noted that
in cases where the member is used several times in a single procedure,
the FRAME_X_DISPLAY method is comparable or better:

x_clear_glyph_string_rect, x_draw_stretch_glyph_string:

  Before: 3 offsets
  After:  4 offsets


  Before: 4 offsets
  After:  4 offsets


  Before: up to 9 offsets
  After:  4 offsets


  Before 3 + 2 * ceiling ((xmax - x1)/dx) offsets
  After: 4 offsets

>> The only other location that FRAME_X_DISPLAY appears in non-X code is in
>> the argument to Free_Pixmap in image.c, which can hopefully be
>> refactored out in a later patch; at that point the other terms can
>> remove their trivial FRAME_X_DISPLAY definitions.
> So should we do both in one go, perhaps?

Sure, here's a patch that does it:

Attachment: 0001-Convert-Free_Pixmap-macro-into-terminal-hook.patch
Description: Free_Pixmap

reply via email to

[Prev in Thread] Current Thread [Next in Thread]