[Gegl-developer] more benchmarking: restrict vs no restrict

2008-09-13 Thread Nicolas Robidoux
Hello: I did some quick benchmarks, having to do with qualifying pointers local to gegl-sampler-yafr.c and gegl-sampler-linear.c with the restrict keyword. The upshoot: Speed wise, this makes not difference. Comments: These functions are fairly simple, so it could be that gcc can untangle a

[Gegl-developer] #defining the restrict keyword

2008-09-13 Thread Nicolas Robidoux
Hello Sven: Given that the restrict keyword may be defined by default for other compilers than gcc (it is in gcc http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Other-Builtins.html wouldn't the following be better? #ifndef restrict #ifndef G_GNUC_RESTRICT #if defined (_

Re: [Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

2008-09-13 Thread Nicolas Robidoux
Short postscript about the benchmark: I got worried that with a scaling factor of 20, since we recompute the exact same piexl coefficients about 400 times, the chip's branch prediction may be performing better than would be typical with more reasonable enlargement ratios. So, I redid the tests

Re: [Gegl-developer] Speeding up/documenting the gegl code

2008-09-13 Thread Øyvind Kolås
On Sat, Sep 13, 2008 at 1:49 PM, Sven Neumann <[EMAIL PROTECTED]> wrote: > Hi, > > On Sat, 2008-09-13 at 08:41 -0400, Nicolas Robidoux wrote: > >> One thing which I would not mind seeing throughout the gegl code is the >> systematic use of the const keyword. > > We will happily accept patches that

Re: [Gegl-developer] Speeding up/documenting the gegl code

2008-09-13 Thread Sven Neumann
Hi, On Sat, 2008-09-13 at 08:41 -0400, Nicolas Robidoux wrote: > One thing which I would not mind seeing throughout the gegl code is the > systematic use of the const keyword. We will happily accept patches that introduce more constness. Pippin, do you agree? Sven __

[Gegl-developer] Speeding up/documenting the gegl code

2008-09-13 Thread Nicolas Robidoux
(Forgive me for preaching, done from the vantage point of a very stubby soapbox.) One thing which I would not mind seeing throughout the gegl code is the systematic use of the const keyword. My understanding is that the const keyword can also be used effectively to indicate to the compiler th

Re: [Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

2008-09-13 Thread Sven Neumann
Hi, I've filed an enhancement request for G_GNUC_RESTRICT: http://bugzilla.gnome.org/show_bug.cgi?id=552098 We should however not wait for this to be included in GLib. As GLib 2.18 has just been released, it will take a while before 2.20 hits the road. Sven _

Re: [Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

2008-09-13 Thread Sven Neumann
Hi, On Sat, 2008-09-13 at 09:37 +0200, Sven Neumann wrote: > It looks like the restrict keyword could be easily wrapped into a macro The following code seems to do the trick. It introduces G_GNUC_RESTRICT, which is actually in the GLib namespace. But I hope that we can convince the GLib develope

Re: [Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

2008-09-13 Thread Sven Neumann
Hi, regarding the use of C99 features, this is a pointer to the last time this question came up among the GLib developers: http://mail.gnome.org/archives/gtk-devel-list/2008-June/msg00020.html The thread linked from this mail might have some interesting arguments that we should consider. Sven

Re: [Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

2008-09-13 Thread Sven Neumann
Hi, On Fri, 2008-09-12 at 19:45 -0400, Nicolas Robidoux wrote: > There is another C99/gcc built-in with the potential to speed up code a lot: > the restrict keyword. > > See: > > http://www.cellperformance.com/mike_acton/2006/05/demystifying_the_restrict_keyw.html It looks like the restrict k