View Single Post
Old 20th October 2008, 06:39 PM
Posts: n/a
Arrow Planned Startup Time Improvements !

The next F9 compiz build will include protobuf ( Protocol Buffers )


What Are Protocol Buffers?

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages – Java, C++, or Python.
This will mean faster startup times ( I have noticed the improvement on the new build , I hope to release it within the next week )

Originally Posted by
Startup Time Improvements (Part 1)

One thing that bothered me about our settings managers (and Compiz) was that they take too long to start. A major reason for this was the XML metadata loading and parsing. Settings managers (ccsm, simple-ccsm, and simple-ccsm-kde) do the metadata parsing through libcompizconfig, whereas Compiz does some metadata parsing itself and some through libcompizconfig when used with CCP (CompizConfig plugin).

Google recently opened up their data interchange format called Protocol Buffers, which has the potential to greatly speed up metadata loading for libcompizconfig and Compiz. So my plan was to load the metadata from binary Protocol Buffers files instead of from XML files in libcompizconfig and Compiz. The libcompizconfig part of that is now complete. The Compiz part will come in the future.

Protocol Buffers metadata parsing works like this: On the first run of Compiz or one of the settings managers, metadata is read from .xml files as before, and then written to binary .pb cache files under (UPDATE) $XDG_CACHE_HOME/compizconfig/ if $XDG_CACHE_HOME is defined and ~/.cache/compizconfig/ otherwise. On subsequent runs, metadata will be read from the .pb cache files resulting in reduced program startup time. If the locale has changed or if new plugins are enabled, the necessary .pb files will be updated at program startup.

Use of Protocol Buffers is enabled by default, but will be disabled automatically at compile time if the protobuf packages mentioned below are not installed. It can also be disabled explicitly at compile time with the –disable-protobuf configure option or at run time by setting the COMPIZ_NO_PROTOBUF environment variable to 1, yes, or true.

Aside from using Protocol Buffers for metadata, there were other changes that improved program startup time, namely removal of global metadata used by libcompizconfig and loading of plugin icons in the background when ccsm starts.

So the overall startup time improvements compared to Compiz Fusion 0.7.8 (at least on my system) are as follows:

Simple-CCSM: starts about 4.5x as fast (78% less time)
CCSM: starts about 2.4x as fast (58% less time)
Compiz (when used with CCP): starts about 1.25x as fast (20% less time)

When Protocol Buffers metadata parsing is implemented in Compiz as well, you will see more startup-time improvement for Compiz. Also, note that these results are for hot startup, that is, not for the first run after a reboot. Cold startup time improvements will vary.

To get the full speedup while testing the changes, make sure you install the protobuf packages as explained below and install the latest git versions of libcompizconfig, compizconfig-python, ccsm, and compiz. NOTE: You may need to do “make distclean” before compiling libcompizconfig.

If you run into any problems, please let us know by filing a bug report at