<?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>Shawn Wilsher &#187; warning</title>
	<atom:link href="http://shawnwilsher.com/archives/tag/warning/feed" rel="self" type="application/rss+xml" />
	<link>http://shawnwilsher.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Dec 2011 10:37:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Query Performance Monitoring</title>
		<link>http://shawnwilsher.com/archives/251</link>
		<comments>http://shawnwilsher.com/archives/251#comments</comments>
		<pubDate>Tue, 10 Mar 2009 20:22:49 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[mozStorage]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[places]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=251</guid>
		<description><![CDATA[Over in bug 481261 I am adding support in mozStorage to warn when a query doesn&#8217;t use an index to sort. This is a debug only warning that uses NS_WARNING to tell you what query is at fault, and the total number of sort operations that were used on it. Luckily, SQLite exposes a handy [...]]]></description>
			<content:encoded><![CDATA[<p>Over in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=481261" title="Expose when queries are being inefficient in debug builds">bug 481261</a> I am adding support in mozStorage to warn when a query doesn&#8217;t use an index to sort.  This is a debug only warning that uses <a href="https://developer.mozilla.org/En/NS_WARNING"><tt>NS_WARNING</tt></a> to tell you what query is at fault, and the total number of sort operations that were used on it.</p>
<p>Luckily, SQLite exposes a <a href="http://www.sqlite.org/c3ref/stmt_status.html">handy function</a> that tells us this information.  In general, you want to use a index in your <tt>ORDER BY</tt> clause so SQLite can use it to generate the order the results a given back.  If you do not use an index, SQLite has to first get all the results in memory, then it sorts them, and then it starts to return results.  If you expect a lot of results, this can get very expensive.</p>
<p>There were suggestions on the newsgroups to also add an API so debuggers such as <a href="http://getfirebug.com/releases/">ChromeBug</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/5817">SQLite Manager</a> could listen for these types of errors.  I&#8217;ll be filing follow-up bugs for some of these suggestions later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/251/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Highlight Warnings in Make</title>
		<link>http://shawnwilsher.com/archives/184</link>
		<comments>http://shawnwilsher.com/archives/184#comments</comments>
		<pubDate>Wed, 03 Dec 2008 19:19:05 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=184</guid>
		<description><![CDATA[Curtis just gave me this incredibly handy piece of code that higlights errors and warnings in make output. Now, when I&#8217;m building, all the warnings are highlighted in yellow, and the errors in red. Just put the following in your bash profile script: make() { pathpat="(/[^/]*)+:[0-9]+" ccred=$(echo -e "\033[0;31m") ccyellow=$(echo -e "\033[0;33m") ccend=$(echo -e "\033[0m") [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://curtisb.posterous.com/">Curtis</a> just gave me this incredibly handy piece of code that higlights errors and warnings in make output.  Now, when I&#8217;m building, all the warnings are highlighted in yellow, and the errors in red.  Just put the following in your bash profile script:</p>
<pre>
make()
{
  pathpat="(/[^/]*)+:[0-9]+"
  ccred=$(echo -e "\033[0;31m")
  ccyellow=$(echo -e "\033[0;33m")
  ccend=$(echo -e "\033[0m")
  /usr/bin/make "$@" 2>&#038;1 | sed -E -e "/[Ee]rror[: ]/ s%$pathpat%$ccred&#038;$ccend%g" -e "/[Ww]arning[: ]/ s%$pathpat%$ccyellow&#038;$ccend%g"
  return ${PIPESTATUS[0]}
}
</pre>
<p>Of course, improvements and more ideas welcome!  Thanks goes to Curtis for this!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/184/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

