<?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/"
	>

<channel>
	<title>awkward.org &#187; iOnTV</title>
	<atom:link href="http://awkward.org/category/iontv/feed/" rel="self" type="application/rss+xml" />
	<link>http://awkward.org</link>
	<description>T &#38; M - Thoughts &#38; Musings</description>
	<lastBuildDate>Sun, 14 Nov 2010 20:40:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Maccamp Boston</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F05%2F09%2Fmaccamp-boston%2F&#038;seed_title=Maccamp+Boston</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F05%2F09%2Fmaccamp-boston%2F&#038;seed_title=Maccamp+Boston#comments</comments>
		<pubDate>Fri, 09 May 2008 15:48:22 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[iOnTV]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://awkward.org/?p=171</guid>
		<description><![CDATA[Maccamp Boston is this weekend &#8211; and I&#8217;m going to go ! I&#8217;m not quite sure what I&#8217;ll talk about (if asked) probably iOnTV (which I&#8217;ve done a bunch of work on recently &#8211; though it&#8217;s not reflected on the website). Oh &#8211; and I got VMware to donate some copies of Fusion for a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://maccampbos.pbwiki.com/" target="_blank">Maccamp Boston</a> is this weekend &#8211; and I&#8217;m going to go !</p>
<p>I&#8217;m not quite sure what I&#8217;ll talk about (if asked) probably <a href="http://iontv-app.com" target="_blank">iOnTV</a> (which I&#8217;ve done a bunch of work on recently &#8211; though it&#8217;s not reflected on the website).</p>
<p>Oh &#8211; and I got <a href="http://www.vmware.com/mac" target="_blank">VMware</a> to donate some copies of Fusion for a raffle too !</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F05%2F09%2Fmaccamp-boston%2F&#038;seed_title=Maccamp+Boston/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s all in the predicate</title>
		<link>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate</link>
		<comments>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate#comments</comments>
		<pubDate>Wed, 27 Feb 2008 02:35:01 +0000</pubDate>
		<dc:creator>awk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iOnTV]]></category>

		<guid isPermaLink="false">http://awkward.org/2008/02/26/its-all-in-the-predicate/</guid>
		<description><![CDATA[Although I might have ordered a new zippy MacBook &#8211; my old PowerBook is still proving its use: highlighting pieces of code that are just too slow. In the iOnTV UI application the schedule grid (list of what&#8217;s on) is a critical part of the main window. I noticed that as the database of program [...]]]></description>
			<content:encoded><![CDATA[<p>Although I might have ordered a new zippy MacBook &#8211; my old PowerBook is still proving its use: highlighting pieces of code that are just too slow.</p>
<p>In the iOnTV UI application the schedule grid (list of what&#8217;s on) is a critical part of the main window. I noticed that as the database of program information got larger scrolling performance in the schedule grid (going backwards/forwards in time) was terribly slow on my PowerBook.</p>
<p>A little time with Shark showed that I was spending 80% my time in the &#8216;fetch schedules on a station between two times&#8217; method. This method used a simple predicate to fetch only those schedule details fulfilling the arguments :</p>
<blockquote><p>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"((station == %@) AND (time &gt;= %@) AND (time &lt;= %@)) OR ((station == %@) AND (time &lt; %@) AND (endTime &gt; %@))", self, startDate, endDate, self, startDate, startDate];</p></blockquote>
<p>A little thinking about it and I realized that the logic was overly complex and could be simplified :</p>
<blockquote><p>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(station == %@) AND (((time &gt;= %@) AND (time &lt;= %@)) OR ((endTime &gt;= %@) AND (endTime &lt;= %@)))", self, startDate, endDate, startDate, endDate];</p></blockquote>
<p>I don&#8217;t need to compare against the station more than once &#8211; start with everything on this station, and then consider only those things that start between the two times or end between the two times.</p>
<p>Result ? The fetch is now less than 10% of the CPU usage when changing the start time in the schedule grid ! Much better ! I still have a couple more optimizations to make &#8211; but watch those predicates !</p>
]]></content:encoded>
			<wfw:commentRss>http://awkward.org/feeder/?FeederAction=clicked&#038;feed=Articles+%28RSS2%29&#038;seed=http%3A%2F%2Fawkward.org%2F2008%2F02%2F26%2Fits-all-in-the-predicate%2F&#038;seed_title=It%26%238217%3Bs+all+in+the+predicate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

