emacs-devel
[Top][All Lists]
Advanced

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

Re: Removing assumption of unsigned long pixel values for colours


From: Stefan Monnier
Subject: Re: Removing assumption of unsigned long pixel values for colours
Date: Mon, 06 May 2019 12:51:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> The original plan was to avoid any conversion at all (no conversion
> necessary on the Emacs side to create the struct of doubles); would you
> still consider the difference between no conversion and 4 conversions to
> be negligible?

That which costs is when we can't use a pre-existing struct and need to
allocate a new struct and copy the values to it (with or without
conversion).

If we need to do the copy anyway, the added cost of a conversion along
the way is very likely to be negligible.  The rule of thumb is that
arithmetic operations are free (contrary to data movement).
[ Which also means that "the conversion" can be costly in the case where
  the need for the conversion in turn requires allocation of
  a new struct.  ]


        Stefan




reply via email to

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