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: Using __builtin_expect (likely/unlikely macros) Date: Sun, 14 Apr 2019 21:11:09 -0600 Message-ID: <875zrgt12q.fsf@gmail.com> References: <87a7gst973.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="209157"; 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: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 15 05:11:36 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 1hFs1v-000sKI-OC for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2019 05:11:35 +0200 Original-Received: from localhost ([127.0.0.1]:43859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFs1r-0001tA-Ia for ged-emacs-devel@m.gmane.org; Sun, 14 Apr 2019 23:11:31 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFs1l-0001su-7L for emacs-devel@gnu.org; Sun, 14 Apr 2019 23:11:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFs1k-0001xk-5I for emacs-devel@gnu.org; Sun, 14 Apr 2019 23:11:25 -0400 Original-Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:42476) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFs1j-0001xK-Th for emacs-devel@gnu.org; Sun, 14 Apr 2019 23:11:24 -0400 Original-Received: by mail-pg1-x530.google.com with SMTP id p6so7843665pgh.9 for ; Sun, 14 Apr 2019 20:11:23 -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=95GrW0jMn7Y2qO3pa2V5qWLyqyY3vG/yyyXTnphgbBE=; b=ezHZhf1g52giXNnBURWFEZNllBfFe36XXr3h7ep5HggY4Aad3iPZ4rUShRTEJW2T4K Ia/sCL9r2FY+OxBGieU+BmkK7mdtutzSJ91PafEg9BPhURyIoYl7h415HlN+gJaUDCNt QDgrYAuhEcdyfScGj1O6SdPKcLuR0PTLhsIn2o8kZMsHj3Puwwh6lfR5V1ODScWHd9k5 ANJmr4J7oKnts9hwJkwPPJGJ0R7x78RIn3wOLc4kU8mLMy6t11gudfc70gWvZ3eXwddI YQvSoi01s/AAs2yh2WuyONW0wBuPOG5DzrYniyaKQdo6awBfELdZviDwo0Vlj/TC7jMJ 52gw== 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=95GrW0jMn7Y2qO3pa2V5qWLyqyY3vG/yyyXTnphgbBE=; b=MEgigQdvKkT4KHSU7LNHpPKs6kSukBBOkOLxenLmq1YAqabka88ak37kea7Z7iA10l JMVtsGtaj0gFbNhdbaJHOMlMpoBfVa07R3+snGwefPljnD59FbinCrtrdhLFieflOrMo LAQ6dRtPhhZsI07OxlkK8ddSsWtdlv9h5vsjZAEhWd0SKMaBKvA4UdAhe2JKtbvLGuTS Upd6Shw/or2JMba9BRx20AZLy1nGOrswaUg7oRM6nWcnGfWttVtzTtdk+ExBF6cqM6vc Blul7nCv4nLB6apLrGNxq/x2S/24KJvRldp8i6cUfjgEgwzOa//qh9rVqe3A82UncxFj vAvg== X-Gm-Message-State: APjAAAXfh5Gwc4XEoFlLQxGU91CmX1vcLof/iDt98y1Kqlo7c+FK2CRI hVYg9wQf0Eb1K4H2IQuh6vc4WaAs X-Google-Smtp-Source: APXvYqxKG4Yp9B2bNZxkolGB4x3xjaGi9yzjX5F8vZfsJ0cIOVULOTKbvrks/8b5b1QJFgzZL4zKRQ== X-Received: by 2002:a63:3c19:: with SMTP id j25mr68427817pga.365.1555297882682; Sun, 14 Apr 2019 20:11:22 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id q74sm78575994pfc.111.2019.04.14.20.11.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 20:11:21 -0700 (PDT) In-Reply-To: (Paul Eggert's message of "Sun, 14 Apr 2019 18:18:13 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::530 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:235470 Archived-At: Paul Eggert writes: > Alex Gramiak wrote: >> the likely/unlikely >> macros are a nice way to indicate that a branch is exceedingly >> rare/common. > > The cost (in making the C code harder to read, write and maintain) so often > exceeds that benefit that I'd rather avoid these macros unless there's a good > performance case for putting them in. I doubt that any performance benefit would be noticeable, at least without some microbenchmarks that I don't have. Though I don't think that these macros, used sparingly around code such as emacs_abort, would make it harder to read/write/maintain. I'm certainly not suggesting to throw them around without care. Still, I understand the resistance to include them.