! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Some 'optimizations' for xfconf
Status:
CLOSED: FIXED
Product:
Xfconf
Component:
Libxfconf

Comments

Description Nick Schermer editbugs 2008-07-28 19:21:34 CEST
Made a small patch to use the latest features in glib.

* Use slice allocator where possible. I know you stance against the slice allocator, but if _should_ be better then g_new and esp. in the xml backend a lot of 'slices' are allocated...
* Use g_intern_static_string where possible, should be a bit faster too.
* Use g_timeout_add_seconds for the save timeout, not a critical timeout, so better sync it with other timeouts to save some ticks.
* Use GSList where possible, you're only walking the lists forward, so these are slightly more efficient.

Dropped the macros in xfconf-common-private.h, looked like the best place to me.
Comment 1 Nick Schermer editbugs 2008-07-28 19:21:47 CEST
Created attachment 1746 
Patch
Comment 2 Nick Schermer editbugs 2008-07-28 19:29:47 CEST
Created attachment 1747 
Patch v2

Sorry, missed 1 include and (hopefully) better code style in the macros.
Comment 3 Brian J. Tarricone (not reading bugmail) 2008-07-28 20:23:28 CEST
The slice macros are unnecessary; we require gtk 2.10/glib 2.12.  Please remove them and just use gslice directly.

The ifdef for g_timeout_add_seconds() just creates noise for no measurable benefit.  Please remove that as well.
Comment 4 Nick Schermer editbugs 2008-07-28 20:41:15 CEST
Created attachment 1748 
Patch v3

Well configure.ac.in still had glib 2.8.0 as dependency version, therefore I added the macros you see ;-).

* Use g_slice directly
* Remove the seconds timeout
* Set 2.12.0 as gobject dependency to be sure
* Left the I_() macro in xfconf-common-private.h,
  personally I think it looks better then all the
  direct calls to g_intern_static_string().
Comment 5 Nick Schermer editbugs 2008-07-28 21:00:11 CEST
Created attachment 1749 
Patch v4

Sorry for another patch, but I've missed one GList.

It's the one for user_files/system_files. I've also changed append -> prepend there, that can't hurd right (line 241 in the patch)? I'm not entirely sure here, so I haven't obsoluted the previous patch.
Comment 6 Brian J. Tarricone (not reading bugmail) 2008-07-28 21:03:18 CEST
No, it needs to be append, otherwise the files get read in the wrong order.

Otherwise feel free to commit without that change.
Comment 7 Nick Schermer editbugs 2008-07-28 21:12:35 CEST
Reverted the prepend change and committed in revision 27394.

Bug #4253

Reported by:
Nick Schermer
Reported on: 2008-07-28
Last modified on: 2015-02-16

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
0 users

Version

Version:
GIT Master

Attachments

Patch (11.60 KB, patch)
2008-07-28 19:21 CEST , Nick Schermer
no flags
Patch v2 (11.85 KB, patch)
2008-07-28 19:29 CEST , Nick Schermer
no flags
Patch v3 (10.67 KB, patch)
2008-07-28 20:41 CEST , Nick Schermer
no flags
Patch v4 (11.94 KB, patch)
2008-07-28 21:00 CEST , Nick Schermer
no flags

Additional information