guile-devel
[Top][All Lists]
Advanced

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

Re: Using branch prediction hints (or not)


From: Andy Wingo
Subject: Re: Using branch prediction hints (or not)
Date: Wed, 05 Dec 2007 23:39:53 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Hi Ludovic,

On Tue 04 Dec 2007 21:35, address@hidden (Ludovic Courtès) writes:

> I played with GCC's `__builtin_expect' (patch attached) to provide GCC
> with branch prediction hints in the most obvious situations:
> `SCM_ASSERT'-like macros, `scm_wrong_num_args ()' situations in the
> evaluator, and a few others.
>
> It provides a little improvement on my x86 machine, less than 5% for
> this program:

I think that more than 2% is reasonable for a performance-enhancing
patch.

> +/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006, 2007 Free 
> Software Foundation, Inc.

Wasn't there something recently on gnu-prog-discuss about the X-Y year
form being acceptable?

> +#define SCM_EXPECT_TRUE(_expr)  SCM_EXPECT ((_expr), 1)
> +#define SCM_EXPECT_FALSE(_expr) SCM_EXPECT ((_expr), 0)

A bit of a mouthful. Perhaps we can follow GLib's example and call them
SCM_LIKELY and SCM_UNLIKELY.

Andy
-- 
http://wingolog.org/




reply via email to

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