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

<channel>
	<title>Shawn Wilsher &#187; Mozilla</title>
	<atom:link href="http://shawnwilsher.com/archives/category/mozilla/feed" rel="self" type="application/rss+xml" />
	<link>http://shawnwilsher.com</link>
	<description></description>
	<pubDate>Fri, 26 Jun 2009 05:19:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Asynchronous Storage API Has Landed</title>
		<link>http://shawnwilsher.com/archives/258</link>
		<comments>http://shawnwilsher.com/archives/258#comments</comments>
		<pubDate>Fri, 26 Jun 2009 05:19:10 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[mozStorage]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=258</guid>
		<description><![CDATA[Some time in January I spec&#8217;ed out and API to allow the binding of multiple sets of parameters to a prepared statement and execute it asynchronously.  This could be done in the past, but it was difficult and resource intensive to do (you would have to first clone the statement that you had and [...]]]></description>
			<content:encoded><![CDATA[<p>Some time in January I spec&#8217;ed out and API to allow the binding of multiple sets of parameters to a prepared statement and execute it asynchronously.  This could be done in the past, but it was difficult and resource intensive to do (you would have to first clone the statement that you had and then bind and then pass all the clones to executeAsync).  Say you want to insert a number of rows into a table now.  Your code will look something like this:</p>
<pre lang="JavaScript">
// Note: db is the mozIStorageConnection for our database.
var stmt = db.createStatement("INSERT INTO table_name (table_value)" +
                              "VALUES (:value)");
var values = [
  "val1",
  "val2",
  "val3",
];
var array = stmt.newBindingParamsArray();
for (let i = 0; i < values.length; i++) {
  let params = array.newBindingParams();
  params.bindByName("value", values[i]);
  array.addParams(params);
}
stmt.bindParameters(array);
stmt.executeAsync(); // This will insert all the values into the table.
</pre>
<p>It&#8217;s not the prettiest thing in the wold, and I hope to add some language helpers for JavaScript to make this even easier to use from JavaScript.  Hope you find it useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/258/feed</wfw:commentRss>
		</item>
		<item>
		<title>Asynchronous Location Bar Searches</title>
		<link>http://shawnwilsher.com/archives/255</link>
		<comments>http://shawnwilsher.com/archives/255#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:43:30 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[leaks]]></category>

		<category><![CDATA[location bar]]></category>

		<category><![CDATA[mozStorage]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=255</guid>
		<description><![CDATA[For those of you using the asynchronous location bar add-on, today&#8217;s nightly of both mozilla-central and mozilla-1.9.1 should show a reduction in memory use.  Turns out there was a bit of a leak in mozStorage that would mean you&#8217;d get high memory usage that would never go down.  My bad.
For those of your [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you using the <a href="http://shawnwilsher.com/archives/239">asynchronous location bar add-on</a>, today&#8217;s nightly of both mozilla-central and mozilla-1.9.1 should show a reduction in memory use.  Turns out there was <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=482614" title=" mozStorageVariant leaks its internal data due to non-virtual destructor">a bit of a leak in mozStorage</a> that would mean you&#8217;d get high memory usage that would never go down.  My bad.</p>
<p>For those of your programmers out there, I have a word of advice.  Always make sure you have a virtual destructor in your base class.  If you don&#8217;t, you could spend days tracking down a leak that doesn&#8217;t seem to make sense.  Of course, this probably would have been spotted earlier if we <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=469523" title="Enable TUnit leak log in tinderbox (log)">reported leaks in xpcshell unit tests</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/255/feed</wfw:commentRss>
		</item>
		<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>
		</item>
		<item>
		<title>More fsync and write Reduction</title>
		<link>http://shawnwilsher.com/archives/242</link>
		<comments>http://shawnwilsher.com/archives/242#comments</comments>
		<pubDate>Tue, 03 Mar 2009 23:30:52 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[DTrace]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[fsync]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[places]]></category>

		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=242</guid>
		<description><![CDATA[As you may or may not be aware, my personal mission as of late is to reduce the number of writes and fsyncs that Firefox makes, and move the ones that we do have to make off of the main thread.  The primary target here has been Places, and the work is still continuing.
The [...]]]></description>
			<content:encoded><![CDATA[<p>As you may or may not be aware, my personal mission as of late is to reduce the number of writes and fsyncs that Firefox makes, and move the ones that we do have to make off of the main thread.  The primary target here has been Places, and the work is still continuing.</p>
<p>The Firefox team has been focusing on <a href="https://wiki.mozilla.org/Firefox3.1/Sprints">code sprints</a> to get some small well scoped things done for Firefox 3.1 since we&#8217;ve got a bit more time.  My <a href="https://wiki.mozilla.org/Firefox3.1/Sprints/Places_Expiration_Performance_Refactoring" title="Places Expiration Performance Refactoring">latest sprint</a> can be found over in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480211" title="Stop expiring history on every page visit">bug 480211</a>, where I&#8217;ve removed a write and fsync that we used to do after every page visited.  If we had enough pages in history that were old enough, we would remove them from history.  We now do this off of the main thread, asynchronously at the same time we flush data from our temporary tables to our permanent ones.  The net result is the same number of writes and one less fsync.  Additionally, the write is no longer done on the main thread.</p>
<p>Sadly, I couldn&#8217;t measure any real-world performance gains with my <a href="http://shawnwilsher.com/archives/178">DTrace scripts</a> - in fact I saw no change during several different runs of Tp3 with various places.sqlite files.  It&#8217;s quite possible I did not have the conditions setup correctly to have pages expiring, and I could have spent a few more hours generating just the right places.sqlite file to demonstrate wins in the real world, but the theory behind the patch is pretty simple.  The gain is pretty obvious.</p>
<p>Just another drop in the bucket of performance wins for Firefox.  Stay tuned, as there is more to come!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/242/feed</wfw:commentRss>
		</item>
		<item>
		<title>Test Add-on: Asynchronous Location Bar Searches (Take 3)</title>
		<link>http://shawnwilsher.com/archives/239</link>
		<comments>http://shawnwilsher.com/archives/239#comments</comments>
		<pubDate>Mon, 23 Feb 2009 04:41:11 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[location bar]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[places]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=239</guid>
		<description><![CDATA[It seems as though the past builds still had issues on Windows.  Mook was kind enough to get be a stack of the hang on shutdown folks were seeing, and I&#8217;ve modified the code to avoid making that happen (still not sure why it happened, but I know how it could get there - [...]]]></description>
			<content:encoded><![CDATA[<p>It seems as though the <a href="http://shawnwilsher.com/archives/236">past</a> <a href="http://shawnwilsher.com/archives/230">builds</a> still had issues on Windows.  Mook was kind enough to get be a stack of the hang on shutdown folks were seeing, and I&#8217;ve modified the code to avoid making that happen (still not sure why it happened, but I know how it could get there - bug is filed).  Without further delay, here&#8217;s an <a href="https://services.forerunnerdesigns.com/extensions/get/async-location-bar-test@forerunnerdesigns.com/0.12/">add-on that you can try out with the latest fixes in</a>!  I&#8217;ve been told on irc that this one works much better on Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/239/feed</wfw:commentRss>
		</item>
		<item>
		<title>Test Build: Asynchronous Location Bar Searches (Take 2)</title>
		<link>http://shawnwilsher.com/archives/236</link>
		<comments>http://shawnwilsher.com/archives/236#comments</comments>
		<pubDate>Sun, 22 Feb 2009 06:01:11 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[location bar]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[places]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=236</guid>
		<description><![CDATA[It turns out that I neglected to make the all-important packages-static file changes that would actually result in a build that works for most folks in my previous test builds.  I thought I had fixed that with the last build, but apparently I never submitted it to the try server (I had the line [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that I neglected to make the all-important packages-static file changes that would actually result in a build that works for most folks in my previous test builds.  I thought I had fixed that with <a href="http://shawnwilsher.com/archives/230">the last build</a>, but apparently I never submitted it to the try server (I had the line in my terminal all ready to just press enter though!).</p>
<p>Without further delay, <a href="https://build.mozilla.org/tryserver-builds/2009-02-21_20:53-sdwilsh@shawnwilsher.com-try-1bb16971859/">here is the new test build</a>.</p>
<p>I&#8217;ve also made a <a href="https://services.forerunnerdesigns.com/extensions/get/async-location-bar-test@forerunnerdesigns.com/0.11/">handy little add-on</a> that lets you test this out.  I haven&#8217;t tested this add-on extensively, but it should work out OK.  If you think you see a bug, try the test build first before reporting it please.</p>
<p>Still want your feedback on if you think the results are faster, slower, or about the same, so please follow-up!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/236/feed</wfw:commentRss>
		</item>
		<item>
		<title>Test Build: Asynchronous Location Bar Searches</title>
		<link>http://shawnwilsher.com/archives/230</link>
		<comments>http://shawnwilsher.com/archives/230#comments</comments>
		<pubDate>Fri, 20 Feb 2009 04:01:56 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[location bar]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[places]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=230</guid>
		<description><![CDATA[A few months ago I decided to try to use the asynchronous storage API that was added in Firefox 3.1 to help reduce the pain of disk IO on the main thread.  Sadly, it became quite apparent that this was going to be too big of a change and need to much work to [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I decided to try to use the asynchronous storage API that was added in Firefox 3.1 to help reduce the pain of disk IO on the main thread.  Sadly, it became quite apparent that this was going to be too big of a change and need to much work to make it into 3.1, so I put off doing any more work on it.  However, this week I started working on the patch again, updating it to work with the changes to the location bar and the storage back-end.  Today I finally got it passing all of our existing tests (although, I know of at least one condition where it fails and is untested).</p>
<p>Now that it&#8217;s passing all tests, I feel comfortable posting a test build for folks to try and see if it helps or not.  I should note that the current implementation is pretty dumb and doesn&#8217;t take many opportunities speed up results.  Additionally, there are some other performance wins that are on my mind that become a lot easier to do with this newer implementation.</p>
<p>Admittedly, I haven&#8217;t benchmarked this yet, so I don&#8217;t know how it compares to the existing code.  During causal use, however, it feels no slower than the existing implementation, but I don&#8217;t usually have issues with it.  The goal here is to help out those who do have performance issues with the location bar.  In fact, that&#8217;s exactly the feedback I&#8217;m looking to get.  So, if you are feeling ambitious and willing to live on the wild side for a bit, I&#8217;d like you <a href="https://build.mozilla.org/tryserver-builds/2009-02-20_17:53-sdwilsh@shawnwilsher.com-try-4758fef1cb9/">try this test build</a>.  After a little bit of use, let me know if you think the results are faster, slower, or about the same.  Note: this is build off of mozilla-central, so it&#8217;s like a 3.2a1pre build.</p>
<p>Your feedback is greatly appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/230/feed</wfw:commentRss>
		</item>
		<item>
		<title>Changes</title>
		<link>http://shawnwilsher.com/archives/227</link>
		<comments>http://shawnwilsher.com/archives/227#comments</comments>
		<pubDate>Tue, 03 Feb 2009 04:35:59 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[RTSE]]></category>

		<category><![CDATA[ownership]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=227</guid>
		<description><![CDATA[I have some good news, and I have some bad news.  Since the world is so accustomed to bad news as of late with the economy and what not, I&#8217;ll start with that.
I will no longer be developing my first add-on, the Rooster Teeth Site Extender.  I&#8217;ve established that I simply do not [...]]]></description>
			<content:encoded><![CDATA[<p>I have some good news, and I have some bad news.  Since the world is so accustomed to bad news as of late with the economy and what not, I&#8217;ll start with that.</p>
<p>I will no longer be developing my first add-on, the Rooster Teeth Site Extender.  I&#8217;ve established that I simply do not have time to maintain it, or do the reviews.  It&#8217;s disappointing to both me, and its users to have an owner who isn&#8217;t really owning it.</p>
<p>Now for the good news.  I just saved a bunch of money on my car insurance - er, wait.  That&#8217;s not it.  There is a new maintainer!  In fact, I&#8217;ve already transferred the ownership of the project over to <a href="http://rvb.roosterteeth.com/members/profile.php?uid=357517">him</a>.  He cares a lot more about the project than I do, so it&#8217;s a good fit.</p>
<p>You can still report bugs in the same place as before, but I&#8217;m just a consultant of the project now.  I wish the project luck, and it&#8217;s been fun while it lasted!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/227/feed</wfw:commentRss>
		</item>
		<item>
		<title>Browser Chrome Tests No Longer Leak</title>
		<link>http://shawnwilsher.com/archives/205</link>
		<comments>http://shawnwilsher.com/archives/205#comments</comments>
		<pubDate>Thu, 22 Jan 2009 00:10:17 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[leaks]]></category>

		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=205</guid>
		<description><![CDATA[I just checked in bug 473845 which fixed the last persistent leak in browser chrome tests.  It also dropped the leak threshold down to zero for those tests, so leakers will be spotted immediately and properly backed out.
Rejoice!
]]></description>
			<content:encoded><![CDATA[<p>I just checked in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=473845" title="Break a potential cycle with XPConnect and mozStorageService">bug 473845</a> which fixed the last persistent leak in browser chrome tests.  It also dropped the leak threshold down to zero for those tests, so leakers will be spotted immediately and properly backed out.</p>
<p>Rejoice!</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/205/feed</wfw:commentRss>
		</item>
		<item>
		<title>Finer-grained Controls for Clearing Private Data</title>
		<link>http://shawnwilsher.com/archives/194</link>
		<comments>http://shawnwilsher.com/archives/194#comments</comments>
		<pubDate>Wed, 17 Dec 2008 01:21:26 +0000</pubDate>
		<dc:creator>Shawn Wilsher</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[clear private data]]></category>

		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://shawnwilsher.com/?p=194</guid>
		<description><![CDATA[I semi-recently did some work to add a nice new feature for Firefox 3.1.  The feature is &#8220;Forget About This Site,&#8221; and is a nice addition to our Clear Private Data and Private Browsing features.  Any time you view a history entry (in the history sidebar or in the Library) you get a [...]]]></description>
			<content:encoded><![CDATA[<p>I semi-recently did some work to add a nice new feature for Firefox 3.1.  The feature is &#8220;Forget About This Site,&#8221; and is a nice addition to our Clear Private Data and Private Browsing features.  Any time you view a history entry (in the history sidebar or in the Library) you get a handy context menu item:<br />
<img alt="Forget About This Site Screenshot" src="http://files.shawnwilsher.com/2008/12/16/forget-about-this-site.png" style="float:none;"/></p>
<p>That&#8217;s right!  You can now selectively clear data from a domain (and all of it&#8217;s sub domains) with two clicks of the mouse!  This tries to clear everything we know about a site, with the exception of bookmarks.  There are still a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=464199" title="Forget About this Site doesn't forget about recently closed tabs">number</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=464417" title="Forget About this Site doesn't close open tabs">of</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=464949" title="Forget About this Site should clear any HTTP-authenticated sessions">issues</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=465082" title="Add 'Forget About This Site' to History sidebar's site container context menu">pending</a> with this to make it even more powerful (help wanted!), but as it stands, it&#8217;s pretty nice.  I am, of course, biased.</p>
<p>All <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=460086" title="Library context menu for history items should include 'Delete all data to &lt;domain&gt;'">this work</a> made it in for Firefox 3.1 beta 2, but I&#8217;ve been lazy and am just now getting to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://shawnwilsher.com/archives/194/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
