Hi,
I randomly saw this: http://blogs.gnome.org/jjardon/2010/03/30/improve-performance-use-priv-inste...
For our uses I'm not sure if it affects performance much, but it would be good to remove all FOO_GET_PRIVATE() macros from GObject code.
I removed this macro generation from the Class Builder plugin.
On Tue, 30 Mar 2010 17:19:59 +0000 ntrel@users.sourceforge.net wrote:
Revision: 4791 http://geany.svn.sourceforge.net/geany/?rev=4791&view=rev Author: ntrel Date: 2010-03-30 17:19:59 +0000 (Tue, 30 Mar 2010)
Log Message:
Don't generate FOO_GET_PRIVATE() macro because caching the result in Foo::priv can be much more efficient.
Regards, Nick
On Tue, 30 Mar 2010 18:24:38 +0100, Nick wrote:
Hi,
I randomly saw this: http://blogs.gnome.org/jjardon/2010/03/30/improve-performance-use-priv-inste...
Sweet.
For our uses I'm not sure if it affects performance much, but it would be good to remove all FOO_GET_PRIVATE() macros from GObject code.
Yes.
I removed this macro generation from the Class Builder plugin.
Maybe we could do what Alberto said: keep the FOO_GET_PRIVATE() macros but change them so they use the cached private field. This has the advantage that for existing code you don't need to change so much code. Of course, the changes in Geany's GObject classes aren't that many and for the Class Builder plugin it also doesn't really affect because it is used for *new* code :). But still, I think many GObject developers are kinda used to use FOO_GET_PRIVATE() (including me).
Regards, Enrico
On Tue, 30 Mar 2010 23:25:56 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
For our uses I'm not sure if it affects performance much, but it would be good to remove all FOO_GET_PRIVATE() macros from GObject code.
Yes.
I removed this macro generation from the Class Builder plugin.
Maybe we could do what Alberto said: keep the FOO_GET_PRIVATE() macros but change them so they use the cached private field. This has the advantage that for existing code you don't need to change so much code.
OK, done.
Of course, the changes in Geany's GObject classes aren't that many and for the Class Builder plugin it also doesn't really affect because it is used for *new* code :). But still, I think many GObject developers are kinda used to use FOO_GET_PRIVATE() (including me).
I think it's best not to generate that macro. GObject code is scary enough already IMO :-p
Regards, Nick