<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Slusnys's Weblog</title>
	<atom:link href="http://slusnys.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://slusnys.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 06 Aug 2008 22:21:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='slusnys.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Slusnys's Weblog</title>
		<link>http://slusnys.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://slusnys.wordpress.com/osd.xml" title="Slusnys&#039;s Weblog" />
	<atom:link rel='hub' href='http://slusnys.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Memory requirements of &#8220;browsing-the-calendar&#8221; operation</title>
		<link>http://slusnys.wordpress.com/2008/08/06/memory-requirements-of-browsing-through-the-calendar-operation/</link>
		<comments>http://slusnys.wordpress.com/2008/08/06/memory-requirements-of-browsing-through-the-calendar-operation/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 22:04:43 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=91</guid>
		<description><![CDATA[These operations: Opening Evolution Browsing through the calendar (going back about 30 months) Closing Evolution generated more than 180 live queries: and caused that heap of EDS process grew by more 2,5 MB on my testing calendar: Notes: Going back by month in Evolution generated 5 live queries (for day, week, work week, month and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=91&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These operations:</p>
<ol>
<li>Opening Evolution</li>
<li>Browsing through the calendar (going back about 30 months)</li>
<li>Closing Evolution</li>
</ol>
<p>generated more than 180 live queries:</p>
<div id="attachment_109" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/08/cache_analysis2.png"><img class="size-medium wp-image-109" src="http://slusnys.files.wordpress.com/2008/08/cache_analysis2.png?w=300&#038;h=200" alt="Browsing cache analysis" width="300" height="200" /></a><p class="wp-caption-text">Cache size</p></div>
<p>and caused that heap of EDS process grew by more 2,5 MB on my testing calendar:</p>
<div id="attachment_108" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/08/heap1.png"><img class="size-medium wp-image-108" src="http://slusnys.files.wordpress.com/2008/08/heap1.png?w=300&#038;h=200" alt="Heap" width="300" height="200" /></a><p class="wp-caption-text">Heap grew by more than 2.5 MB</p></div>
<p>Notes:</p>
<ul>
<li>Going back by month in Evolution generated 5 live queries (for day, week, work week, month and list view)</li>
<li>One can notice, that not all queries were freed, when I closed Evolution. However, I verified, that only live queries generated by evolution-alarm-notify process were not freed. This process stays alive even when Evolution is closed.</li>
<li>The first increment of heap size  (from 506K to 8180K) is caused by opening Evolution (opening calendar).</li>
<li>The next smaller increments of heap size are due to live queries.</li>
<li>The last decrement is caused by closing Evolution.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=91&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/08/06/memory-requirements-of-browsing-through-the-calendar-operation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/08/cache_analysis2.png?w=300" medium="image">
			<media:title type="html">Browsing cache analysis</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/08/heap1.png?w=300" medium="image">
			<media:title type="html">Heap</media:title>
		</media:content>
	</item>
		<item>
		<title>EDS live queries leak</title>
		<link>http://slusnys.wordpress.com/2008/08/06/eds-live-queries-leak/</link>
		<comments>http://slusnys.wordpress.com/2008/08/06/eds-live-queries-leak/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 13:21:52 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=94</guid>
		<description><![CDATA[I wanted to take closer look on the memory consumption of  &#8220;browsing-through-the-calendar&#8221; operation. As I have probably found a bug, I will post about this later. The bug: when one clicks on the clock applet, live query, that watches the actual month is generated (and calendar window appears). Another click on the clock applet  (to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=94&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to take closer look on the memory consumption of  &#8220;browsing-through-the-calendar&#8221; operation. As I have probably found a bug, I will post about this later.</p>
<p>The bug: when one clicks on the clock applet, live query, that watches the actual month is generated (and calendar window appears). Another click on the clock applet  (to hide the calendar window) &#8211; live query IS NOT destroyed (ECalViewListener object is destroyed, but EDataCalView object is not destroyed).  Next click on the calendar window  -  the same live query is generated again (new calendar client was created).</p>
<p>Here is the picture documenting the error : As I was clicking on the clock applet (almost every second), the number of live queries was increasing and they were not destroyed.</p>
<p><a href="http://slusnys.files.wordpress.com/2008/08/cache_analysis1.png"><img class="aligncenter size-medium wp-image-100" src="http://slusnys.files.wordpress.com/2008/08/cache_analysis1.png?w=300&#038;h=200" alt="" width="300" height="200" /></a></p>
<p>To reproduce the bug:</p>
<ol>
<li>export ORBIT2_DEBUG_STRMAX=1000</li>
<li>export ORBIT2_DEBUG=traces</li>
<li>Click on the clock applet a few times. Watch, that the same live queries are generated.</li>
<li>Open Evolution and create some event in actual month.</li>
<li>Watch CORBA communication &#8211; every live queries will be informed, that new object was created by <strong>notifyObjectsAdded</strong> method</li>
</ol>
<p>As it seems to me, we are destroying live queries only when orbit connection is disconnected. However, there are so many listeners and views, that I am little bit confused, still.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=94&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/08/06/eds-live-queries-leak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/08/cache_analysis1.png?w=300" medium="image" />
	</item>
		<item>
		<title>Where are these files from ?</title>
		<link>http://slusnys.wordpress.com/2008/07/31/where-are-these-files-from/</link>
		<comments>http://slusnys.wordpress.com/2008/07/31/where-are-these-files-from/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 09:23:16 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=79</guid>
		<description><![CDATA[In my last post, I found out that my parsed calendar.ics file consumes more than 7MB in memory. I decided to look on eds with massif. As I have only this one calendar in Evolution, I expected to get similar results. Here is the massif graph I got: It&#8217;s about 13.8 MB. Looking closer on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=79&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last post, I found out that my parsed calendar.ics file consumes more than 7MB in memory. I decided to look on eds with massif. As I have only this one calendar in Evolution, I expected to get similar results. Here is the massif graph I got:</p>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/massif_with_journal_task.png"><img class="size-medium wp-image-84" src="http://slusnys.files.wordpress.com/2008/07/massif_with_journal_task.png?w=300&#038;h=225" alt="EDS under massif" width="300" height="225" /></a><p class="wp-caption-text">EDS under massif</p></div>
<p>It&#8217;s about 13.8 MB. Looking closer on massif logs, I found out, that almost all allocations were done in method  e_cal_backend_file_open. Next investigations <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  led to the finding, that files $HOME/.evolution/calendar/local/system/tasks.ics and $HOME/.evolution/memos/local/system/journal.ics should be blamed for that.</p>
<p>Now, the most interesting thing is the content of those files. Both files contain only time zones. A lot of copies of the same time zone. Is that a feature or a bug ? <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><code><br />
slusny@turret:~/.evolution$ grep BEGIN:VTIMEZONE ~/.evolution/tasks/local/system/tasks.ics | wc -l<br />
538<br />
slusny@turret:~/.evolution$ grep "TZID:/softwarestudio.org/Olson_20011030_5/Africa/Algiers" ~/.evolution/tasks/local/system/tasks.ics | wc -l<br />
318<br />
slusny@turret:~/.evolution$ grep BEGIN:VTIMEZONE /home/slusny/.evolution/memos/local/system/journal.ics | wc -l<br />
814<br />
</code></p>
<p>Here is the massif graph, when I removed these two files:</p>
<div id="attachment_85" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/massif_without_journal_task.png"><img class="size-medium wp-image-85" src="http://slusnys.files.wordpress.com/2008/07/massif_without_journal_task.png?w=300&#038;h=225" alt="EDS under massif with removed journal.ics and tasks.ics" width="300" height="225" /></a><p class="wp-caption-text">EDS under massif with removed journal.ics and tasks.ics</p></div>
<p><strong>Note 1.8.2008:</strong> Files journal.ics and tasks.ics are growing only when eds is restarted (either it was killed or segfaulted&#8230;).</p>
<p>To reproduce the bug, it is enough to re-run the evolution and activate the calendar view.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=79&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/07/31/where-are-these-files-from/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/massif_with_journal_task.png?w=300" medium="image">
			<media:title type="html">EDS under massif</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/massif_without_journal_task.png?w=300" medium="image">
			<media:title type="html">EDS under massif with removed journal.ics and tasks.ics</media:title>
		</media:content>
	</item>
		<item>
		<title>Memory consumption of big calendar</title>
		<link>http://slusnys.wordpress.com/2008/07/29/memory-consumption-of-big-calendar/</link>
		<comments>http://slusnys.wordpress.com/2008/07/29/memory-consumption-of-big-calendar/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 15:32:11 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=53</guid>
		<description><![CDATA[How much memory is  consumed by the calendar ? I hope, that this post helps to answer the question. I will use my favourite big calendar.ics file. Some basic facts about calendar: slusny@turret:~/gsoc/massif logs$ ls -lh calendar.ics -rw-r--r-- 1 slusny slusny 813K 2008-07-28 14:15 calendar.ics slusny@turret:~/gsoc/massif logs$ grep VEVENT calendar.ics &#124; wc -l 2550 Saying [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=53&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How much memory is  consumed by the calendar ? I hope, that this post helps to answer the question.</p>
<p>I will use my favourite big calendar.ics file. Some basic facts about calendar:</p>
<p><code><br />
slusny@turret:~/gsoc/massif logs$ ls -lh calendar.ics<br />
-rw-r--r-- 1 slusny slusny <strong>813K</strong> 2008-07-28 14:15 calendar.ics</code></p>
<p>slusny@turret:~/gsoc/massif logs$ grep VEVENT calendar.ics | wc -l<br />
<strong>2550</strong></p>
<p>Saying this, I consider the calendar as a big one.  I prepared simple program, that just opens the calendar and parses the ICS file, similarly to file backend. Valgrind&#8217;s massif gave me this graph</p>
<p><code><br />
MB<br />
7.192^                                                              ,,:. .<br />
|                                                        . . @ @#:: :.<br />
|                                                    . @@: : @ @#:: ::<br />
|                                                  @@: @@: : @ @#:: ::<br />
|                                               ,, @@: @@: : @ @#:: ::@<br />
|                                            . @@@ @@: @@: : @ @#:: ::@<br />
|                                         .. : @@@ @@: @@: : @ @#:: ::@<br />
|                                      .@ :: : @@@ @@: @@: : @ @#:: ::@<br />
|                                    ,@:@ :: : @@@ @@: @@: : @ @#:: ::@<br />
|                                 ,@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:<br />
|                              ,: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:<br />
|                           , :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:<br />
|                         @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:<br />
|                    ., @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:<br />
|                 . ,:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@:.<br />
|               .@: @:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@::<br />
|            , @:@: @:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@::<br />
|         ,:@@ @:@: @:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@::<br />
|     , @ @:@@ @:@: @:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@::<br />
|    @@ @ @:@@ @:@: @:@ @ @@@ :@: @@ @@:@ :: : @@@ @@: @@: : @ @#:: ::@::<br />
0 +-----------------------------------------------------------------------&gt;Mi<br />
0                                                                   287.6<br />
</code></p>
<p>So, the calendar consumes more thatn 7 MB. I ran the program again without valgrind and looked at process<br />
with smem.pl script. This script parses /proc/$pid/smaps into something more useful<br />
<code><br />
VMSIZE:      18136 kb<br />
RSS:         10784 kb total<br />
2864 kb shared<br />
168 kb private clean<br />
7752 kb private dirty</code></p>
<p>PRIVATE MAPPINGS<br />
vmsize   rss clean   rss dirty   file<br />
7148 kb        0 kb     7148 kb   [heap]<br />
40 kb        0 kb       40 kb   /usr/local/lib/libORBit-2.so.0.1.0<br />
44 kb        0 kb       40 kb   /home/slusny/gsoc/evolution-data-server/calendar/libecal/.lib<br />
88 kb        0 kb       36 kb   [stack]<br />
&#8230;</p>
<p>The heap is shown as smaller here (who knows why ?). However, the calendar is quite big, I think. Perhaps iwe should not hold all events (event prehistoric ones) and all event fields in memory all the time <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=53&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/07/29/memory-consumption-of-big-calendar/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>
	</item>
		<item>
		<title>First results of optimization</title>
		<link>http://slusnys.wordpress.com/2008/07/17/first-results-of-optimization/</link>
		<comments>http://slusnys.wordpress.com/2008/07/17/first-results-of-optimization/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 23:03:46 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=39</guid>
		<description><![CDATA[In this post I will describe impact of new more efficient data structure on calendar part of EDS. The new data structure is our famous interval tree. Imagine, that we are maintainers of calendar data and enemy is asking us expensive questions about our data, mostly &#8220;give me events in some time range&#8221;. In the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=39&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post I will describe impact of new more efficient data structure on calendar part of EDS. The new data structure is our famous interval tree. Imagine, that we are maintainers of calendar data and enemy is asking us expensive questions about our data, mostly &#8220;give me events in some time range&#8221;. In the past, we took naive approach to answer questions. Now, we are doing more wisely.</p>
<p>On the attached picture is shown, how many events need to be scanned to evaluate query. Red color are queries BEFORE optimization &#8211; either 1271 or 346 items were scanned (I have two calendars with 1271 and 346 items and before optimization, all events are scanned to answer question). The green line shows, how many items need to be scanned after optimization.</p>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/queries_comparison.png"><img class="size-medium wp-image-40" src="http://slusnys.files.wordpress.com/2008/07/queries_comparison.png?w=300&#038;h=225" alt="Number of events scanned before and after optimization" width="300" height="225" /></a><p class="wp-caption-text">Number of events scanned before and after optimization</p></div>
<p>One can notice, that there is green (optimized) query on the beginning that was doing scan through all events. This is query, in which no subexpression of from *occur-in-range* was<br />
found &#8211; it was not question of form &#8220;give me all events in some time range&#8221;. Therefore, interval tree did not help us.</p>
<p><strong>More results:</strong></p>
<ul>
<li>More numbers &#8211; how many took to evaluate query ?
<div id="attachment_44" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/times.png"><img class="size-medium wp-image-44" src="http://slusnys.files.wordpress.com/2008/07/times.png?w=300&#038;h=200" alt="Comparison of performance - time to evaluate query" width="300" height="200" /></a><p class="wp-caption-text">Comparison of performance - time to evaluate query</p></div></li>
</ul>
<ul>
<li> How many items was tested (sum of 423 queries) ? For every tested event we had to generate recurrences.</li>
</ul>
<p><div id="attachment_48" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/scanned_items.png"><img class="size-medium wp-image-48" src="http://slusnys.files.wordpress.com/2008/07/scanned_items.png?w=300&#038;h=200" alt="Number of scanned events" width="300" height="200" /></a><p class="wp-caption-text">Number of scanned events</p></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=39&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/07/17/first-results-of-optimization/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/queries_comparison.png?w=300" medium="image">
			<media:title type="html">Number of events scanned before and after optimization</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/times.png?w=300" medium="image">
			<media:title type="html">Comparison of performance - time to evaluate query</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/scanned_items.png?w=300" medium="image">
			<media:title type="html">Number of scanned events</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing interval trees</title>
		<link>http://slusnys.wordpress.com/2008/07/17/testing-interval-trees/</link>
		<comments>http://slusnys.wordpress.com/2008/07/17/testing-interval-trees/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 22:09:17 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=36</guid>
		<description><![CDATA[After implementing interval trees, I have started to think about testing them. It would be great to have some test script. To do this, I would need to think about different scenarios, that can happen &#8211; different ways of inserting and removing data can lead to different rotations, for example. Of course, I did not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=36&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After implementing interval trees, I have started to think about testing them. It would be great to have some test script. To do this, I would need to think about different scenarios, that can happen &#8211; different ways of inserting and removing data can lead to different rotations, for example. Of course, I did not want to spend too much time on testing.</p>
<p>Therefore I have written small test program, that inserts random events into interval tree and list, does several searches, deletes some events and  does some searches again. I have found several bugs this way.</p>
<p>But how can I be sure, that all interesting situations were tested ? I have used great <strong>gcov</strong> and <strong>lcov</strong> tools. Almost 90% of code was covered by tests, and although the remaining code is not so important, I would like to add more tests in the future. The <strong>valgrind</strong> did not show me any memory leaks. This is my tip for your  better sleep: test your code.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=36&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/07/17/testing-interval-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>
	</item>
		<item>
		<title>Interval trees in EDS</title>
		<link>http://slusnys.wordpress.com/2008/07/17/interval-trees-in-eds/</link>
		<comments>http://slusnys.wordpress.com/2008/07/17/interval-trees-in-eds/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 22:08:19 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=32</guid>
		<description><![CDATA[Finally, I have finished implementation of inteval trees. Less or more, I have followed the book Introduction to Algorithms, 2nd edition. My implementation is based on red-black trees,  too. EDS is often asked for events in some time range (interval). In times before interval trees, we had to go through all events, generate recurrences and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=32&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_23" class="wp-caption aligncenter" style="width: 310px"><a href="http://slusnys.files.wordpress.com/2008/07/tree.jpg"><img class="size-medium wp-image-23" src="http://slusnys.files.wordpress.com/2008/07/tree.jpg?w=300&#038;h=96" alt="Interval tree" width="300" height="96" /></a><p class="wp-caption-text">Interval tree</p></div>
<p>Finally, I have finished implementation of inteval trees. Less or more, I have followed the book Introduction to Algorithms, 2nd edition. My implementation is based on red-black trees,  too. EDS is often asked for events in some time range (interval). In times before interval trees, we had to go through all events, generate recurrences and test, if the event is in this range. With interval tree, we can do it much faster.</p>
<p>The data in the tree (events in our case) are accessed by interval queries. Underlaying data structure is a red black tree with the low endpoint chosen as a key. To do efficient interval search, each node needs to maintain some additional data &#8211; maximum (<strong>max</strong>) and minimum  (<strong>min</strong>) value of any interval endpoint stored in the subtree rooted at x. It is needed to update <strong>min</strong> and <strong>max</strong> fields when performing rotations, inserting and deleting new data.</p>
<p>Basic operations, like insert, delete and search, are simple, as we already know about red-black trees. They can be done in logarithmic time. The interesting operation is &#8220;search all&#8221;, which should return all events in given interval. To search for events, we start in the root of the tree and check if we should go left or right &#8211; the <strong>min</strong> and <strong>max</strong> fields of the left and right son help us to make correct decision. Sometimes it is needed to go in both directions. Therefore, time can be O( min(n, k lg n) ), where k is the number of events in output list and n is the total number of events.</p>
<p>If someone is interested in implementation, here are some differences between my implementation and book:</p>
<ul>
<li>The code in the book is keeping only <strong>min</strong> field, not <strong>max</strong> (<strong>max</strong> field help us to make more effective decisions)</li>
<li>We need to store different events with the same interval and search by UID of the event</li>
<li>We need to work with open-ended intervals (special value -1)</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=32&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/07/17/interval-trees-in-eds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/07/tree.jpg?w=300" medium="image">
			<media:title type="html">Interval tree</media:title>
		</media:content>
	</item>
		<item>
		<title>Evolution Data Server Under Sysprof</title>
		<link>http://slusnys.wordpress.com/2008/06/04/evolution-data-server-under-sysprof/</link>
		<comments>http://slusnys.wordpress.com/2008/06/04/evolution-data-server-under-sysprof/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 23:19:32 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=13</guid>
		<description><![CDATA[My gsoc task is to speed up calendar part of e-d-s. These days I have been using  evo calendar extensively. My aim was to identify the most serious bottlenecks by sysprof. Here are the results of my 5 minute session. The tests were carried out on big calendars, which I received from Federico. Several things [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=13&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">My gsoc task is to speed up calendar part of e-d-s. These days I have been using  evo calendar extensively. My aim was to identify the most serious bottlenecks by sysprof.</p>
<p style="text-align:left;">Here are the results of my 5 minute session. The tests were carried out on big calendars, which I received from Federico.</p>
<p style="text-align:left;"><a href="http://slusnys.files.wordpress.com/2008/06/start_query.png"><img class="aligncenter size-medium wp-image-14" src="http://slusnys.files.wordpress.com/2008/06/start_query.png?w=300&#038;h=187" alt="Sysprof analysis of evolution data server" width="300" height="187" /></a></p>
<p style="text-align:left;">Several things should be noticed:</p>
<ul style="text-align:left;">
<li>Almost all system time is divided between Evo and Firefox</li>
<li>About 30% of system time was spent in Evolution, 15% in e-d-s.</li>
<li>I was using only file backend (e-d-s time was spent in <strong>e_cal_backend_file_start_query</strong> <strong>-</strong> <strong>14%</strong>)</li>
</ul>
<p style="text-align:left;">Analysis:</p>
<ul style="text-align:left;">
<li>Almost all e-d-s time was spent in <strong>e_cal_backend_start_query &#8211; 14%</strong>. This method is called by e-d-s clients (Evolution, clocks&#8230;) and does complete sweep  through the calendar. Clients want to get back calendar objects filtered by some expression (sexp).</li>
<li> For every calendar object, test against the expression is carried out (<strong>e_cal_backend_sexp_match_comp</strong> <strong>- 11%</strong>),  generating all recurrences.  Usually, the evaluation of expression leads to test, if event occurs in some time range (<strong>func_occur_in_time_range</strong> <strong>- 6%</strong>). The second very often used function seems to be  <strong>e_cal_backend_sexp_func_make_time &#8211; 3.9%.</strong> Both  these functions sooner or later call function <strong>icaltime_as_timet_with_zone</strong>, in which is spent 3.60% and 3.13% &#8211; summing up to about 6.7% of system time. In fact, these functions are usually called together, because the typical test is &#8220;<strong>occur-in-time-range? (make-time \&#8221;ISO_DATE_STR\&#8221;) (make-time \&#8221;ISO_DATE_STR\&#8221;)&#8221;. </strong>The expression  make-time &#8220;ISO_DATE_STR&#8221; leads to calling <strong>e_cal_backend_sexp_func_make_time</strong>, which converts date from iso string to time_t value. Expression <strong>occur-in-time-range </strong>leads<strong> </strong>to calling <strong>func_occur_in_time_range</strong>.</li>
<li>When constructing expression &#8220;<strong>occur-in-time-range? (make-time \&#8221;ISO_DATE_STR\&#8221;) (make-time \&#8221;ISO_DATE_STR\&#8221;)&#8221;, </strong>time_t value is converted to the string. Later, when evaluating expression, string is converted to time_t (by make-time).</li>
</ul>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;"><a href="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone.png"><img class="aligncenter size-medium wp-image-15" src="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone.png?w=300&#038;h=187" alt="Time spent in converting time formats" width="300" height="187" /></a><a href="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone1.png"><img class="aligncenter size-medium wp-image-16" src="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone1.png?w=300&#038;h=187" alt="Time spent in converting time formats" width="300" height="187" /></a></p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:left;">Conclusions:</p>
<ul style="text-align:left;">
<li>In e-d-s we spent about 15% of system time, and almost 7% was spent in <strong>icaltime_as_timet_with_zone</strong>. The function is called to find out, if calendar event occurs in some time range.  There is a lot of time conversion from time_t to string and back.  The rest was spent by sweeping through the calendar objects and generating recurrences.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=13&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/06/04/evolution-data-server-under-sysprof/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/06/start_query.png?w=300" medium="image">
			<media:title type="html">Sysprof analysis of evolution data server</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone.png?w=300" medium="image">
			<media:title type="html">Time spent in converting time formats</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/06/icaltime_as_timet_with_zone1.png?w=300" medium="image">
			<media:title type="html">Time spent in converting time formats</media:title>
		</media:content>
	</item>
		<item>
		<title>EDS and it&#8217;s cache &#8211; analyze this</title>
		<link>http://slusnys.wordpress.com/2008/05/22/eds-and-its-cache-analyze-this/</link>
		<comments>http://slusnys.wordpress.com/2008/05/22/eds-and-its-cache-analyze-this/#comments</comments>
		<pubDate>Thu, 22 May 2008 15:52:17 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=4</guid>
		<description><![CDATA[The story Evolution data server is process living (unnoticed if you are lucky ) in your Desktop.  Besides other things, it takes care of calendar data. Clients (programs, that need calendar data &#8211; Evolution, clock applet&#8230;) send questions (called queries) to e-d-s. Typical query looks like &#8220;give me all events in some time range&#8221;. At [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=4&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;">
<p style="text-align:center;"><strong>The story</strong></p>
<p style="text-align:left;">Evolution data server is process living (unnoticed if you are lucky <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) in your Desktop.  Besides other things, it takes care of calendar data. Clients (programs, that need calendar data &#8211; Evolution, clock applet&#8230;) send questions (called queries) to e-d-s. Typical query looks like &#8220;give me all events in some time range&#8221;.</p>
<p style="text-align:left;">At some point during Evolution&#8217;s development, developers informally determined that calendar queries to e-d-s were slow.  Nobody took the trouble of actually figuring out why they were slow, so someone added a simple cache instead. Now it&#8217;s time to do more optimization.</p>
<p style="text-align:center;"><strong>The task</strong></p>
<p>The task is to find out, if the cache is useful ( taking into account, that it consumes some memory). That is, we have to answer these questions:</p>
<ol>
<li>Which queries get performed, and how often ?</li>
<li>What is the lifetime of the cached queries?</li>
<li>How long do queries take to be performed?</li>
<li>Is the cache useful ?</li>
</ol>
<p style="text-align:center;"><strong>Our approach<br />
</strong></p>
<p style="text-align:left;">Together with my great mentor Federico, I have added some logging subsystem to to e-d-s. It logs each calendar query. I have implemented Python script, that can analyze this log and sort queries to various criteria and produce some gnuplot graphs. Following graphs were generated by the script in one of my typical workdays.</p>
<p style="text-align:center;"><strong>1. Which queries get performed and how often ?<br />
</strong></p>
<p style="text-align:left;">First graph shows how  the cache size is changing (green line) during the day. The cache size is the number of different queries stored in cache. Query gets into cache, when some client wants e-d-s to execute (answer) it, and the query is not found in the cache yet. The peaks correspond to massive usage of Evolution (I was browsing through the calendar). After 13:00 I opened the Evolution and closed  it  before 14:00. The next two peaks correspond again to opening/closing Evolution. The red bar shows, how many queries e-d-s answered without executing it &#8211; results were already cached. Obviously, this number can be greater than cache size, because some queries are re-executed several times.</p>
<p style="text-align:left;">
<p style="text-align:left;">
<p style="text-align:center;"><a href="http://slusnys.files.wordpress.com/2008/05/cache_analysis.png"><img class="size-full wp-image-6" src="http://slusnys.files.wordpress.com/2008/05/cache_analysis1.png?w=450&#038;h=300" alt="Ananalysis of cache" width="450" height="300" /></a></p>
<p style="text-align:left;">Ok, so we would like to know how many times were individual queries used. Are the queries used uniformly or small part of queries are used again and again ?</p>
<p style="text-align:center;"><img src="http://slusnys.files.wordpress.com/2008/05/queries_usage_counts.png?w=450&#038;h=300" alt="" width="450" height="300" /></p>
<p style="text-align:left;">There were almost 370 different queries, from which 180 was not reused  while sitting in cache. The mostly used query was reused 9 times.</p>
<p style="text-align:left;">
<p style="text-align:center;"><strong> </strong></p>
<p style="text-align:left;">
<p style="text-align:center;"><strong>2. What is the lifetime of the cached queries ?</strong></p>
<p style="text-align:left;">The ambition of the following graph is to gain insight into queries lifetime. As can be seen from the picture, there were about 320 different queries. Six queries lived more than 10000 secs, majority of them lived about 4000 secs and more than 100 queries lived just for several seconds. As can be noticed from the picture (if it is not too small), about 30 queries (at the rear of the graph) have negative lifetime values &#8211; these queries were not destroyed at all. The queries coming from alarm daemon fall into this category.</p>
<p style="text-align:center;"><img class="aligncenter" src="http://slusnys.files.wordpress.com/2008/05/queries_lifetime.png?w=450&#038;h=300" alt="Liffetime of queries" width="450" height="300" /></p>
<p style="text-align:left;">
<p style="text-align:center;"><strong>3. How long do queries take to be performed ? </strong></p>
<p style="text-align:left;">This is great opportunity  to present another graph.</p>
<p style="text-align:center;"><img class="aligncenter" src="http://slusnys.files.wordpress.com/2008/05/queries_duration.png?w=450&#038;h=300" alt="" width="450" height="300" /></p>
<p style="text-align:left;">As can be seen from the graph, it depends on backend that we are using. In case of file backend (first two columns) the execution of query is really fast. In the last two columns there are values for google calendar backend. It takes 0.01 secs to execute the query in average and 0.1 sec in worst case.</p>
<p style="text-align:center;"><strong>4. Is the cache useful ?</strong></p>
<p style="text-align:left;">So what do you think ?  In my opinion the cache is useful, mainly when we expect to work with remote calendars. Perhaps we should ask, if it is worth the memory, that it consumes ( I&#8217;m not trying to say that it consumes too much memory, I do not know, but some developers have this opinion ).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=4&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/05/22/eds-and-its-cache-analyze-this/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/05/cache_analysis1.png" medium="image">
			<media:title type="html">Ananalysis of cache</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/05/queries_usage_counts.png" medium="image" />

		<media:content url="http://slusnys.files.wordpress.com/2008/05/queries_lifetime.png" medium="image">
			<media:title type="html">Liffetime of queries</media:title>
		</media:content>

		<media:content url="http://slusnys.files.wordpress.com/2008/05/queries_duration.png" medium="image" />
	</item>
		<item>
		<title>GSoC 2008: Optimizing EDS calendar</title>
		<link>http://slusnys.wordpress.com/2008/05/06/google-summer-of-code-optimizing-eds-calendar/</link>
		<comments>http://slusnys.wordpress.com/2008/05/06/google-summer-of-code-optimizing-eds-calendar/#comments</comments>
		<pubDate>Tue, 06 May 2008 21:19:32 +0000</pubDate>
		<dc:creator>slusnys</dc:creator>
				<category><![CDATA[gsoc2008]]></category>
		<category><![CDATA[gsoc]]></category>

		<guid isPermaLink="false">http://slusnys.wordpress.com/?p=3</guid>
		<description><![CDATA[Hello friends, so I’ve been accepted onto the Google Summer of Code 2008 program to work on optimizing calendar part of EDS. The main goal of this blog is to discuss my work (and life) with you. So, feel free to leave any comments. Interesting thoughts about EDS, that directly apply to my work can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=3&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello friends,</p>
<p>so I’ve been accepted onto the Google Summer of Code 2008 program to work on optimizing calendar part of EDS. The main goal of this blog is to discuss my work (and life) with you. So, feel free to leave any comments.</p>
<p>Interesting thoughts about EDS, that directly apply to my work can be found at blogs of <a href="http://www.burtonini.com/blog/computers/eds-replacements-2008-03-18-17-00">Ross</a>, <a href="http://pvanhoof.be/blog/index.php/2008/03/20/re-eds-and-memory">Philip</a> and <a href="http://www.gnome.org/~federico/news-2008-03.html#18">Federico</a>.</p>
<p>You can see my commits at my <a href="http://github.com/slusnys">github repository</a>.</p>
<p>My first task is to analyze performance of calendar queries cache. These days I am preparing patches to log every calendar query. If you use calendar with Evolution, I would appreciate, if you could provide me e-d-s logs to analyze. Please, contact me, if you are interested.</p>
<p>As I live in Prague, I am looking forward to meeting at least some of you at Ubuntu Developer Summit next week.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/slusnys.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/slusnys.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/slusnys.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/slusnys.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/slusnys.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=slusnys.wordpress.com&amp;blog=3660001&amp;post=3&amp;subd=slusnys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://slusnys.wordpress.com/2008/05/06/google-summer-of-code-optimizing-eds-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b1d4d3cb6685c62d1b1519446b9c844b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">slusnys</media:title>
		</media:content>
	</item>
	</channel>
</rss>
