From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: Removing assumption of unsigned long pixel values for colours Date: Mon, 06 May 2019 14:03:11 -0600 Message-ID: <87lfzjic5c.fsf@gmail.com> References: <87v9yqjdnh.fsf@gmail.com> <83a7g2kqsi.fsf@gnu.org> <87lfzlkeic.fsf@gmail.com> <83zho0khdu.fsf@gnu.org> <87h8a8k84a.fsf@gmail.com> <83pnowjo63.fsf@gnu.org> <878svjk1g0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="119986"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 06 22:03:22 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNjpY-000V3y-K3 for ged-emacs-devel@m.gmane.org; Mon, 06 May 2019 22:03:20 +0200 Original-Received: from localhost ([127.0.0.1]:33388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNjpX-0004lW-LB for ged-emacs-devel@m.gmane.org; Mon, 06 May 2019 16:03:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNjpR-0004lF-UZ for emacs-devel@gnu.org; Mon, 06 May 2019 16:03:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNjpP-0003dW-UO for emacs-devel@gnu.org; Mon, 06 May 2019 16:03:13 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:38211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNjpM-0003cF-3e for emacs-devel@gnu.org; Mon, 06 May 2019 16:03:09 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id 10so7337144pfo.5 for ; Mon, 06 May 2019 13:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=srAQwLuFZWY1YkeCjC41dotQ5mEWq3eLykmuuyvmCG0=; b=KjvVq/uDxPf7krCOwzTNghKf8MSC5wZ1hGCKEWm+PPWPTgyFM3BNgYv4bShPRhKzXc faudCgr68mYtkHwrP5ZHZK2z7W+hjbOyBNkyzIFIofrx/znqSvMaa798njlO5xrS1T1O Q/Wvj7TaFVrFMy28axqE10uicH2YUwV+8APQE8Orgsnr6UwwKUtSrGo9+tNz1ZpEs4KU JxZ2RhNPPYDcS1+nNSzEmCfG7GJuenYfDEsJBYv4PY+15tQrWP1h4PK6TE7B2VGIVScU joP8W9K0zWn9vsYZq5218bhcMETHR9Tu+fri6hrQahZPwRI1IpEZKhmLin74Zw+JXge+ rdQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=srAQwLuFZWY1YkeCjC41dotQ5mEWq3eLykmuuyvmCG0=; b=mQd+sOg5S0HvtK0e1Ajro/xW6ZsHQAMBCQvBhjM6RFQmY2pAzwB5mVk9wLk2eN7G8/ CGORnys9KxKDmqdXBJnx6ICv/FSHFP5QQlO6GXr/+eI67vANHK05zkXd6b/BXnm8nod3 mpaQ4lSvbjAbWF4MtZjgpgAB3gTbCVxo//KY8uGrdKLpbRhedMO9RqJEflMjvkKJB4UE dgU6MRaDldH8mw0oFlHdd4gL4oWSmrCUNykT3jur/mmjPrr/i5zdIdhCLIqlBE6p9k1u u1HJ/EEhvS6EeYZOPPpIZ7llCPlgQKJHL//5Vnh8T8dJpX35tc9qagFtca2YkDR9z6I8 djBg== X-Gm-Message-State: APjAAAWDxjd8tAJFJ4T5MI/sxHUhGbKBc31ynYXbpql5oAtbmfPXqKit Oc7wWG+bX8Yw8/rR+xDDLxI03pVT X-Google-Smtp-Source: APXvYqz8i3+txMZ0lqL4mKlZ3FnF3PFtwbXfpgrqMIYznq41KdnVbn1+GHUZ1K1rpXfGvhm4adiZsg== X-Received: by 2002:a65:534b:: with SMTP id w11mr34632057pgr.210.1557172985744; Mon, 06 May 2019 13:03:05 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id y20sm14227360pfe.188.2019.05.06.13.03.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 13:03:05 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 06 May 2019 12:51:24 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236212 Archived-At: Stefan Monnier 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.