Hi Ludovic, On Tue 04 Dec 2007 21:35, [EMAIL PROTECTED] (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/ _______________________________________________ Guile-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/guile-devel
