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: Alex Gramiak
Subject: Re: Removing assumption of unsigned long pixel values for colours
Date: Mon, 06 May 2019 14:03:11 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> 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).

The no-conversion method I was proposing wouldn't involve heap
allocation, but it would involve copying the doubles around from, e.g.,
a frame struct to GC struct.

I might have been able to avoid some of those copies by using GdkRGBA
pointers in the GC structs.

> 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).

I knew that they're efficient, but I thought given the high frequency of
draw operations that it would do well to shave them off. I guess my
intuition isn't great on this topic.



reply via email to

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