Re: Overhead of type casting when using GObject system

2013-02-12 Thread Mikkel Kamstrup Erlandsen
On 10 February 2013 15:22, Emmanuele Bassi eba...@gmail.com wrote: On 10 February 2013 13:57, Ross Lagerwall rosslagerw...@gmail.com wrote: On Sun, Feb 10, 2013 at 11:08:31AM +, Emmanuele Bassi wrote: disabling cast checks is usually the result of performance profiling, tho, so it

Re: Overhead of type casting when using GObject system

2013-02-11 Thread Chris Vine
On Sun, 10 Feb 2013 11:08:31 + Emmanuele Bassi eba...@gmail.com wrote: On 9 February 2013 12:43, Lanoxx lan...@gmx.net wrote: However those cast checks can be disabled at compile time removing the overhead, so GTK_WIDGET(foo) would be equivalent to (GtkWidget *) foo. Ah thats good

Re: Overhead of type casting when using GObject system

2013-02-10 Thread Emmanuele Bassi
On 9 February 2013 12:43, Lanoxx lan...@gmx.net wrote: However those cast checks can be disabled at compile time removing the overhead, so GTK_WIDGET(foo) would be equivalent to (GtkWidget *) foo. Ah thats good to know. But still I believe that most applications that are shipped with gnome

Re: Overhead of type casting when using GObject system

2013-02-10 Thread Lanoxx
Hi Emanuele, thanks for the comprehensive response. On 10/02/13 12:08, Emmanuele Bassi wrote: On 9 February 2013 12:43, Lanoxx lan...@gmx.net wrote: However those cast checks can be disabled at compile time removing the overhead, so GTK_WIDGET(foo) would be equivalent to (GtkWidget *) foo. Ah

Re: Overhead of type casting when using GObject system

2013-02-10 Thread Ross Lagerwall
On Sun, Feb 10, 2013 at 11:08:31AM +, Emmanuele Bassi wrote: disabling cast checks is usually the result of performance profiling, tho, so it should only be used if you have profiled your application code and verified that type casting is high on the profiles; there are also various ways

Re: Overhead of type casting when using GObject system

2013-02-10 Thread Emmanuele Bassi
On 10 February 2013 13:57, Ross Lagerwall rosslagerw...@gmail.com wrote: On Sun, Feb 10, 2013 at 11:08:31AM +, Emmanuele Bassi wrote: disabling cast checks is usually the result of performance profiling, tho, so it should only be used if you have profiled your application code and verified

Overhead of type casting when using GObject system

2013-02-09 Thread Lanoxx
Hi, I am looking for information about the type system used in GType and GObject. Im am interested to know, how much overhead is created by the type casting macros. AFAIK types in GTK can be dynamic as well as static [1]. I am assuming that most types in GTK are static types. But still if I am

Re: Overhead of type casting when using GObject system

2013-02-09 Thread Alberto Garcia
On Sat, Feb 09, 2013 at 10:53:25AM +0100, Lanoxx wrote: So if in C if write this: GtkGrid* grid = gtk_grid_new(); GtkWidget* widget = GTK_WIDGET(grid); then this creates more overhead then when in Java I write this: JTabel tabel = new JTabel(); Object object = tabel; // No cast required.

Re: Overhead of type casting when using GObject system

2013-02-09 Thread Alberto Garcia
On Sat, Feb 09, 2013 at 01:43:43PM +0100, Lanoxx wrote: However those cast checks can be disabled at compile time removing the overhead, so GTK_WIDGET(foo) would be equivalent to (GtkWidget *) foo. Ah thats good to know. But still I believe that most applications that are shipped with gnome