Re: gtk 1.2 and gtk 2.4

Hi Owen,

> > Hello,
> > 
> > C/C++ interpreter Ch has bindings to GTK 2.4.
> > We noticed that the speed of running GTK application in Ch is very slow. 
> > However, the speed for bindings to GTK 1.2 is fine. 
> > 
> > The reasons I noticed is that the header files in the new release (2.4)
> > contains many internal functions. They are too big and takes
> > too much time to interprete in Ch.
> There are almost no internal functions in the GTK+ header files that
> I'm aware of. (A quick grep though the GTK+ headers reveals about
> 100 functions starting with _gtk as compared to about 2700 public
> entry points. So, a very small fraction.)
> GTK+-2.x is a much more complex system than GTK+-1.2; there really
> isn't much of a way around that... it's bigger because it does 
> more. 
> To use it from an interpreter, you'll have to figure out some way
> of quickly processing the 42,000 lines of header files. (Up from
> around 22,000 in GTK+-1.2)

I use "wc glib/* gdk/* gtk/* ", there are about 100,000 lines of header
files for GTK 2.4. 

So you mean there are almost no internal functions/structures in 
GTK+ header files?

It appears that msft's VC++  header files
only contain external functions and
structures, macros only
for Windows API, not for internally ones.

In X11/Motif,the private one header files are used as
XXX_p.h, which corresponds to XXX.h.
Application developers and programs do not need XXX_p.h.
They are not distributed for application developers.

The GUI C applications using X11/Motif, Win32 API can be handled 
without execution speed problem in Ch. Not sure if GTK+ can have
smaller header files? 

Ch SDK for interface binary C/C++ is now bundled in Ch 5.0 for free.
We intend to release the source code for Ch binding to GTK+. So this binding
can be built automatically and synchronized whenever the new GTK+
is released. It is pity that GTK+ runs too slow.

> Maybe it's possible to precompile them to an
> intermediate form and cache the results of that.

Ch can only call the precompiled functions with available header files
(containing function prototype). 
We will consider how to have the header files pre-compiled in the future
though we don't have solution now.

Xiaodong Zhou
Ch: Free C/C++ interpreter

> Regards,
> 						Owen

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