Re: [pygtk] Overriding GObject methods in Python

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

 



-----BEGIN PGP SIGNED MESSAGE-----Hash: SHA1
Hrvoje Nikšić wrote:> On Thu, 2006-11-23 at 17:20 +0100, Johan Dahlin wrote:>> You seem to be very worried about performance. > > Only for low-level code, where C would be used for efficiency.  Ideally,> calling C methods from C code should be as fast as invoking a function> via a function pointer (possibly achieved by caching the method lookup).> Calling Python from C or C from Python can involve hashtable lookups,> performance is obviously not a priority there.> >> I advise you to try it out and see if it meets your requirements.>>>> If it doesn't, rewrite the whole thing in C.> > Your advice is sound and it works well for most projects.  For some> larger projects a bit more planning is needed because by the time the> project reaches a prototype stage, it might be too late to rewrite it in> C.> > In the case of the project I'm working on, the prior code base was> written in Scheme, using an interpreter I will call "Morass" to protect> the innocent.  An object system was designed on top of Morass's CLOS> implementation, and Morass's GTk bindings were bound to these custom> objects to form the GUI layer.
If the Scheme codes are even remotely portable, there are Schemeimplementations that compile to native code and give good performance.
If that's not enough, and at the risk of sounding glib, is there areason you aren't using Common Lisp with your CLOS?  A port to CL wouldprobably be more straightforward than either a port to C and wouldresult in something much more maintainable than sticking yet anotherlanguage in the mix (if I understand what you're trying to do here).You'd get your performance and likely a vastly better MOP implementation.
Chris.
-----BEGIN PGP SIGNATURE-----Version: GnuPG v1.4.3 (GNU/Linux)Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFZ1l3key5QmfOctcRAj2IAJ0QM9HcQCYUAtIQGy+E0ULwz65vpACeOxVdjG/lA27PRg6LrRkMAXRgcrw==NcWJ-----END PGP SIGNATURE-----_______________________________________________gtk-list mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux