<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>…for the adult in you &#187; Iain&#8217;s compositor</title>
	<atom:link href="http://blogs.gnome.org/metacity/category/compositing/iains-compositor/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/metacity</link>
	<description>"Many window managers are like Marshmallow Froot Loops; Metacity is like Cheerios."</description>
	<lastBuildDate>Sat, 13 Feb 2010 19:15:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>		<item>
		<title>Squib of the day: speed up alt-tab under compositing</title>
		<link>http://blogs.gnome.org/metacity/2009/01/27/squib-of-the-day-speed-up-alt-tab-under-compositing/</link>
		<comments>http://blogs.gnome.org/metacity/2009/01/27/squib-of-the-day-speed-up-alt-tab-under-compositing/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 12:00:32 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bug of the day]]></category>
		<category><![CDATA[Iain's compositor]]></category>
		<category><![CDATA[Switching]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=284</guid>
		<description><![CDATA[ GNOME bug 504729 suggests that switching with alt-tab, while using compositing, is too slow.  This is because all the images of the windows are scaled on the client side before the window is displayed.
There are two possible answers to this problem.
Firstly, we can check for key release while scaling is happening, and if [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Light Switch Complicator by L. Marie, on Flickr" href="http://www.flickr.com/photos/lenore-m/510420532/"><img src="http://farm1.static.flickr.com/224/510420532_b0696a6e8e.jpg" alt="Light Switch Complicator" width="375" height="500" align="right" /></a> <a href='http://bugzilla.gnome.org/show_bug.cgi?id=504729' class='bug-link bug-link-gnome'>GNOME bug 504729</a> suggests that switching with alt-tab, while using compositing, is too slow.  This is because all the images of the windows are scaled on the client side before the window is displayed.</p>
<p>There are two possible answers to this problem.</p>
<p>Firstly, we can check for key release while scaling is happening, and if one is received, abort scaling and simply switch to the next application.</p>
<p>Secondly, scaling can be faster if it&#8217;s done server-side.  This is possible but apparently there&#8217;s a common bug that it hits.  Fixing this would also mean that we got to have <a href="http://blogs.gnome.org/metacity/2009/01/25/squib-of-the-day-live-previews-in-alt-tab/">animated previews</a> easily.</p>
<p>I think the first solution should be added in any case, and the second should be added when it&#8217;s possible.  I can add the first solution; I&#8217;m not sure I know enough to fix the second.</p>
<p>Photo © L. Marie, cc-by.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/01/27/squib-of-the-day-speed-up-alt-tab-under-compositing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Squib of the day: Exposé</title>
		<link>http://blogs.gnome.org/metacity/2009/01/26/bug-of-the-day-expose/</link>
		<comments>http://blogs.gnome.org/metacity/2009/01/26/bug-of-the-day-expose/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 12:00:44 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bug of the day]]></category>
		<category><![CDATA[Iain's compositor]]></category>
		<category><![CDATA[Switching]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=277</guid>
		<description><![CDATA[In  GNOME bug 502491 someone is asking for an effect like Exposé on OS X.  Iain, who wrote the compositor and ought to know, believes it would be better done as a separate program.  There was an attempt to do this a while back, called Expocity, but nothing much came of it.  Does this [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Expose by Underpuppy, on Flickr" href="http://www.flickr.com/photos/underpuppy/2683609338/"><img src="http://farm4.static.flickr.com/3239/2683609338_8818de753e.jpg" alt="Expose" width="375" height="500" align="right" /></a>In  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=502491' class='bug-link bug-link-gnome'>GNOME bug 502491</a> someone is asking for an effect like <a href="http://support.apple.com/kb/HT2503">Exposé on OS X</a>.  Iain, who wrote the compositor and ought to know, believes it would be better done as a separate program.  There was an attempt to do this a while back, called <a href="http://apple.slashdot.org/article.pl?sid=03/11/25/0330208">Expocity</a>, but nothing much came of it.  Does this mean the bug is INVALID?  Should the external program exist?  Anyone fancy doing it?</p>
<p>Includes the memorable exchange:<br />
<em> &#8220;Every time I propose an enhancement, you say &#8216;go for it&#8217;.  What are you doing?&#8221;<br />
&#8220;I&#8217;m cooking my dinner.  What are you doing?&#8221;</em></p>
<p>If it <em>was</em> a separate program, it could be activated by a mouse button or a keybinding in the same way that, say, Print Screen is currently activated.  The program could move windows about using the EWMH, but I don&#8217;t see how an external utility could tell the compositor to scale the contents of windows down and back again.  <span style="text-decoration: line-through;">Iain, can you throw me a clue?</span> <em>Update</em>: <a href="http://bugzilla.gnome.org/show_bug.cgi?id=502491#c20">Thanks.</a></p>
<p><a href="http://blogs.gnome.org/metacity/2009/01/25/squib-of-the-day-live-previews-in-alt-tab/#comment-688">Someone said yesterday</a> in the discussion on animated previews in the alt-tab switcher that an Exposé-like effect would be good for everything that animated previews would, and more.</p>
<p>Photo © Underpuppy, cc-by-nd-sa.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/01/26/bug-of-the-day-expose/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Squib of the day: Live previews in alt-tab</title>
		<link>http://blogs.gnome.org/metacity/2009/01/25/squib-of-the-day-live-previews-in-alt-tab/</link>
		<comments>http://blogs.gnome.org/metacity/2009/01/25/squib-of-the-day-live-previews-in-alt-tab/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 23:05:47 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Bug of the day]]></category>
		<category><![CDATA[Iain's compositor]]></category>
		<category><![CDATA[Switching]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=274</guid>
		<description><![CDATA[True to my promise, here&#8217;s the first bug/squib of the day.
In  GNOME bug 567757 someone is asking for live previews in the alt-tab window.  I can&#8217;t think why this would actually be useful, as opposed to pretty, and it sounds like a lot of work and a source of new bugs.  I am therefore [...]]]></description>
			<content:encoded><![CDATA[<p>True to my promise, here&#8217;s the first bug/squib of the day.</p>
<p>In  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=567757' class='bug-link bug-link-gnome'>GNOME bug 567757</a> someone is asking for live previews in the alt-tab window.  I can&#8217;t think why this would actually be useful, as opposed to pretty, and it sounds like a lot of work and a source of new bugs.  I am therefore minded to say no.  Can anyone think of why it might be worth the trouble?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2009/01/25/squib-of-the-day-live-previews-in-alt-tab/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Compositor command-line switches</title>
		<link>http://blogs.gnome.org/metacity/2008/07/29/compositor-command-line-switches/</link>
		<comments>http://blogs.gnome.org/metacity/2008/07/29/compositor-command-line-switches/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 14:40:26 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Iain's compositor]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2008/07/29/compositor-command-line-switches/</guid>
		<description><![CDATA[It seems, from reading blogs and forums, that many people like the idea of using Metacity&#8217;s compositor but are scared of changing the deep magic of gconf.  In addition, there is nothing in the &#8220;&#8211;help&#8221; text to show that we have a compositor at all.  Therefore, I propose a new switch to override [...]]]></description>
			<content:encoded><![CDATA[<p>It seems, from reading blogs and forums, that many people like the idea of using Metacity&#8217;s compositor but are scared of changing the deep magic of gconf.  In addition, there is nothing in the &#8220;&#8211;help&#8221; text to show that we have a compositor at all.  Therefore, I propose a new switch to override the current gconf setting for the compositor, which will display in &#8220;&#8211;help&#8221;, and for symmetry another switch to turn it off again.</p>
<p>I am not sure whether &#8211;compositor and &#8211;no-compositor, or &#8211;composite and &#8211;no-composite, would be better names.</p>
<p>What do <i>you</i> think?  Tell us at  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=545323' class='bug-link bug-link-gnome'>GNOME bug 545323</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2008/07/29/compositor-command-line-switches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some compositor issues</title>
		<link>http://blogs.gnome.org/metacity/2007/12/20/some-compositor-debugging-stuff/</link>
		<comments>http://blogs.gnome.org/metacity/2007/12/20/some-compositor-debugging-stuff/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 12:27:50 +0000</pubDate>
		<dc:creator>iain</dc:creator>
				<category><![CDATA[2.21]]></category>
		<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[Compositing]]></category>
		<category><![CDATA[Iain's compositor]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/12/20/some-compositor-debugging-stuff/</guid>
		<description><![CDATA[So, now that the compositor is in trunk and everyone is excited, this might be a good time to mention some &#8220;issues&#8221;.
Firstly, it seems that there are some weird shadow redrawing problems&#8230;these just appeared recently, so it shouldn&#8217;t be hard to find the offending commit. I think I know what it is, I just need [...]]]></description>
			<content:encoded><![CDATA[<p>So, now that the compositor is in trunk and everyone is excited, this might be a good time to mention some &#8220;issues&#8221;.</p>
<p>Firstly, it seems that there are some weird shadow redrawing problems&#8230;these just appeared recently, so it shouldn&#8217;t be hard to find the offending commit. I think I know what it is, I just need to work out why its not working.</p>
<p>Next: Now that some windows have argb visuals some buggy themes may have translucent parts where there weren&#8217;t translucent parts before. Gilouche was one of these themes and Jimmac fixed it up recently. So if you start seeing through the window title bars, tell your theme author.</p>
<p>Also, I&#8217;ve been getting reports of terrible performance and rendering issues with xgl. It seems xgl doesn&#8217;t like any of the non-GL compositors, so I don&#8217;t know what to do about that.</p>
<p>Finally, on a happier note &#8211;  a big thank you to whoever bought me stuff from my <a href="http://www.amazon.co.uk/gp/registry/wishlist/3VINA8P9ZISIQ/ref=cm_wl_rlist_go/202-8370567-8974264?ie=UTF8&amp;sort=title&amp;layout=standard">wishlist</a>. Its much appreciated, even if it did take me two days before I noticed my parents had piled up my mail in a weird place while I was away&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/12/20/some-compositor-debugging-stuff/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>2.21.5 is out, with the compositor</title>
		<link>http://blogs.gnome.org/metacity/2007/12/19/2215-is-out-with-the-compositor/</link>
		<comments>http://blogs.gnome.org/metacity/2007/12/19/2215-is-out-with-the-compositor/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 12:39:45 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[2.21]]></category>
		<category><![CDATA[Iain's compositor]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/12/19/2215-is-out-with-the-compositor/</guid>
		<description><![CDATA[
Thanks to Iain Holmes and Thomas Thurman for improvements in this version. This is the first unstable release to contain the new compositor; please try it out and let us know how it goes for you. Downstream maintainers should note that its GConf key is initially turned off in src/metacity.schemas.in and consider whether to turn [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://arglist.com/cgi-bin/image?gallery=river_ver&amp;name=20051002-052"><img align="right" src="http://marnanel.org/pics/lj/meta/AL_river/20051002-052t.jpg"/></a></p>
<p>Thanks to Iain Holmes and Thomas Thurman for improvements in this version. This is the first unstable release to contain <a href="http://blogs.gnome.org/metacity/category/compositing/iains-compositor/">the new compositor</a>; please try it out and let us know how it goes for you. Downstream maintainers should note that its GConf key is initially turned off in src/metacity.schemas.in and consider whether to turn it on by default in their packages.</p>
<ul>
<li>merge compositor branch! (Iain ) (<a href='http://bugzilla.gnome.org/show_bug.cgi?id=499081' class='bug-link bug-link-gnome'>GNOME bug 499081</a>)</li>
<li>print &#8220;Subversion&#8221; and not &#8220;CVS&#8221; when building (Thomas)</li>
</ul>
<p>Translations:<br />
Jorge González (es), Kjartan Maraas (nb), Daniel Nylander (sv)</p>
<p>Source:</p>
<ul>
<li>3d3ac7dc8e52981af032e35171789e60  <a href="http://ftp.gnome.org/pub/GNOME/sources/metacity/2.21/metacity-2.21.5.tar.bz2">metacity-2.21.5.tar.bz2</a></li>
<li>eef55d7ce921b23d0749155876d53873  <a href="http://ftp.gnome.org/pub/GNOME/sources/metacity/2.21/metacity-2.21.5.tar.gz">metacity-2.21.5.tar.gz</a></li>
</ul>
<p><i>Photo: Footbridge over the River Ver, Hertfordshire, England. Photographer: Gary Houston. Public domain.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/12/19/2215-is-out-with-the-compositor/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Compositor on trunk</title>
		<link>http://blogs.gnome.org/metacity/2007/12/19/compositor-on-trunk/</link>
		<comments>http://blogs.gnome.org/metacity/2007/12/19/compositor-on-trunk/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 03:54:59 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Iain's compositor]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/12/19/compositor-on-trunk/</guid>
		<description><![CDATA[Iain&#8217;s compositor is now on trunk since it now meets every requirement I wrote about here. It looks gorgeous. It will be in the next unstable release, which will happen before the weekend. Do not use bucket-o-bling any more; it is a dead branch. Work will continue on trunk. This closes  GNOME bug 499081. [...]]]></description>
			<content:encoded><![CDATA[<p><b>Iain&#8217;s compositor is now on trunk</b> since it now meets every requirement I wrote about <a href="http://blogs.gnome.org/metacity/2007/12/13/fettuccine/">here</a>. It looks gorgeous. It will be in the next unstable release, which will happen before the weekend. Do not use bucket-o-bling any more; it is a dead branch. Work will continue on trunk. This closes  <a href='http://bugzilla.gnome.org/show_bug.cgi?id=499081' class='bug-link bug-link-gnome'>GNOME bug 499081</a>. All kudos goes to Iain.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/12/19/compositor-on-trunk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>When Iain&#8217;s compositor will be merged</title>
		<link>http://blogs.gnome.org/metacity/2007/12/13/fettuccine/</link>
		<comments>http://blogs.gnome.org/metacity/2007/12/13/fettuccine/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 20:06:48 +0000</pubDate>
		<dc:creator>Thomas Thurman</dc:creator>
				<category><![CDATA[Iain's compositor]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/12/13/fettuccine/</guid>
		<description><![CDATA[Someone asked about this and I was going to tell them, but then I thought I&#8217;d say it here. I will merge Iain&#8217;s compositor branch when:

there are no known

large memory leaks
security holes
crashes


it can be turned off entirely from ./configure and GConf
when it is turned off in GConf or ./configure, the code paths are substantially the [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked about this and I was going to tell them, but then I thought I&#8217;d say it here. I will merge Iain&#8217;s compositor branch when:</p>
<ul>
<li>there are no known
<ul>
<li>large memory leaks</li>
<li>security holes</li>
<li>crashes</li>
</ul>
</li>
<li>it can be turned off entirely from ./configure and GConf</li>
<li><strong>when it is turned off</strong> in GConf or ./configure, the code paths are substantially the same as before the merge</li>
<li>I actually compile it myself and see it working on a computer in front of me</li>
<li>there are no smaller nitpicks like coding style and so on</li>
</ul>
<p>So far most of these have been met, but not all at once. Note that &#8220;it all works perfectly&#8221; is <em>not</em> a criterion: it is important that it&#8217;s easily testable in standard unstable releases. On the other hand, &#8220;Metacity is as stable as before if you turn compositing off&#8221; is a very important criterion.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/12/13/fettuccine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trip the light fantastic</title>
		<link>http://blogs.gnome.org/metacity/2007/11/29/trip-the-light-fantastic/</link>
		<comments>http://blogs.gnome.org/metacity/2007/11/29/trip-the-light-fantastic/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 19:38:37 +0000</pubDate>
		<dc:creator>iain</dc:creator>
				<category><![CDATA[Compositing]]></category>
		<category><![CDATA[Iain's compositor]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/11/29/trip-the-light-fantastic/</guid>
		<description><![CDATA[Useful uses for a compositor #1
Some videos this time, they&#8217;re not particularly good quality but that doesn&#8217;t matter. First &#8211; http://folks.o-hand.com/iain/watch-updates.ogg
Its like acid, but cheaper!
So what exactly are we seeing? 
Well, everytime a section of the screen needs to be redrawn, the compositor draws it correctly, and then picks a random colour and overlays that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Useful uses for a compositor #1</strong></p>
<p>Some videos this time, they&#8217;re not particularly good quality but that doesn&#8217;t matter. First &#8211; <a href="http://folks.o-hand.com/iain/watch-updates.ogg">http://folks.o-hand.com/iain/watch-updates.ogg</a></p>
<p>Its like acid, but cheaper!</p>
<p><strong>So what exactly are we seeing? </strong></p>
<p>Well, everytime a section of the screen needs to be redrawn, the compositor draws it correctly, and then picks a random colour and overlays that colour on the region that was redrawn. So you can watch screen updates as they happen. Just by watching the colours change.</p>
<p><strong>Besides being a cheap night in, what use is it? </strong></p>
<p>Well, here is video #2 &#8211; <a href="http://folks.o-hand.com/iain/totem-button.ogg">http://folks.o-hand.com/iain/totem-button.ogg</a></p>
<p>Again, crap quality, but down in the bottom left corner of the screen, we can see that something is constantly redrawing itself. That something is the totem-mozilla play button. It seems to be constantly redrawing itself for no apparent reason. Bastien got a <a href="http://bugzilla.gnome.org/show_bug.cgi?id=500496">bug</a> for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/11/29/trip-the-light-fantastic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Shoot speed kill light</title>
		<link>http://blogs.gnome.org/metacity/2007/11/28/shoot-speed-kill-light/</link>
		<comments>http://blogs.gnome.org/metacity/2007/11/28/shoot-speed-kill-light/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 20:12:57 +0000</pubDate>
		<dc:creator>iain</dc:creator>
				<category><![CDATA[Bugs and issues]]></category>
		<category><![CDATA[Compositing]]></category>
		<category><![CDATA[Iain's compositor]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/metacity/2007/11/28/shoot-speed-kill-light/</guid>
		<description><![CDATA[Some recent changes to the compositor made it feel kinda slow and laggy. Not in a noticable way but more in a subconscious something feels wrong way. I tested xfwm and it seemed fine running as a compositor, and given that Metacity&#8217;s compositor has the same heritage as xfwm&#8217;s and I&#8217;ve been checking the xfwm [...]]]></description>
			<content:encoded><![CDATA[<p>Some recent changes to the compositor made it feel kinda slow and laggy. Not in a noticable way but more in a subconscious something feels wrong way. I tested xfwm and it seemed fine running as a compositor, and given that Metacity&#8217;s compositor has the same heritage as xfwm&#8217;s and I&#8217;ve been checking the xfwm code to see how they do things, I thought that was suggesting that there was something wrong with the Metacity one. I couldn&#8217;t see anything abnormal or strange looking at/comparing the codebase, so I turned to valgrind and oprofile. Running callgrind didn&#8217;t really show anything about the compositor code though, but as always with callgrind stuff gets lost in amongst the small functions like g_type_check_instance_is_a and the wonderfully mysterious &lt;cycle 8&gt;</p>
<p>My expectations were that some of the compositor functions would be topping the profile, given that the redrawing functions need to run anytime something changes on the desktop (modulo that they&#8217;re called from an idle handler so some redraw events are merged together) but what Oprofile said was</p>
<p><code>samples % symbol name</code></p>
<p><code>13908    21.8501  pos_eval_helper<br />
10471    16.4504  pos_tokenize<br />
7621     11.9729  meta_color_spec_render<br />
5408      8.4962  compositor_idle_cb<br />
3785      5.9464  fix_region<br />
1559      2.4493  meta_draw_op_draw_with_env<br />
1511      2.3738  free_tokens<br />
1480      2.3251  meta_parse_position_expression</code></p>
<p>Eh? What are pos_eval_helper, pos_tokenize and meta_color_spec_render and why are they so high up the profile? Well, it turns out they&#8217;re part of the theme parsing code (Metacity has a very powerful, but complex theme format dontcha know?), but some more debugging showed that the theme expressions were being reparsed and re-evaluated every time Metacity had to draw a window frame.  The impressive screenshot for this is:</p>
<p><img src="http://folks.o-hand.com/iain/metacity-draw-profile.png" height="499" width="670" /></p>
<p>Just look how many times pos_tokenize and pos_eval_helper are called when a draw op is drawn. That is one complicated function call chart.</p>
<p>Looking through the code I saw that draw operations were stored as their string format, like  &#8220;2 * width + Bmin / height % 7&#8243;. These expressions were first tokenised (in pos_tokenize) into constituent parts (&#8216;2&#8242; &#8216;*&#8217; &#8216;width&#8217; etc) and they were then evaluated. Thing is that these strings cannot be changed at all so they can be tokenised when loading the theme rather than every time they are evaluated.</p>
<p>meta_color_spec_render is a similar problem. Colours can be defined as a basic colour, a GTK theme colour, a shade of a colour, or from two colours blended together. With shaded and blended colours they were generated every time Metacity had to use that colour, which is an obvious waste of time as the colour specs cannot be changed after they are created and so the colours should just be generated whenever the spec is created and then it becomes a simple function to get the correct colours.</p>
<p>All this is filed as <a href="http://bugzilla.gnome.org/show_bug.cgi?id=500279">bug #500279</a> and the patch attached to the bug fixes these two issues.</p>
<p>pos_eval_helper is the function that calculates the theme expressions from their tokenised state and it still gets called every time the theme needs redrawn, which sort of makes sense, as the variables may have changed since the last time, but it looks to me like the variables are all related to the width/height of the window, so it may be that we can make it so that the expressions are only re-evaluated when the width/height changes. I&#8217;ll have to look into it.</p>
<p>Anyway, with the patch from bug #500279 applied this is what the profile looks like now&#8230;<br />
<code><br />
9355     32.4815  compositor_idle_cb<br />
7129     24.7526  pos_eval_helper<br />
1070      3.7151  meta_parse_size_expression<br />
1020      3.5415  event_callback<br />
604       2.0971  meta_compositor_process_event<br />
597       2.0728  .plt<br />
542       1.8819  win_extents<br />
531       1.8437  pos_eval<br />
519       1.8020  meta_frame_style_draw<br />
495       1.7187  meta_draw_op_draw_with_env</code></p>
<p>The compositor functions are up where they should be&#8230;getting rid of that pos_eval_helper would be nice though, as evinced by this screenshot of the same function as above, but with the patch applied. The function is a lot less busy, which is a good thing, but the three sets of calls to pos_eval_helper could possibly be reduced somehow.</p>
<p><img src="http://folks.o-hand.com/iain/metacity-draw-profile2.png" /></p>
<p>Anyway, the compositor seems faster, and I didn&#8217;t even touch that code this time :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/metacity/2007/11/28/shoot-speed-kill-light/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
