<?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></title>
	<atom:link href="http://blog.mozilla.org/vdjeric/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.org/vdjeric</link>
	<description>Vladan Djeric&#039;s blog</description>
	<lastBuildDate>Tue, 11 Jun 2013 18:00:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Performance Update, Issue #3</title>
		<link>http://blog.mozilla.org/vdjeric/2013/06/11/performance-update-issue-3/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/06/11/performance-update-issue-3/#comments</comments>
		<pubDate>Tue, 11 Jun 2013 18:00:12 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=145</guid>
		<description><![CDATA[This is a post summarizing the activities of the Performance team over the past week. You can see the full weekly Engineering progress report for all teams here: https://wiki.mozilla.org/Platform/2013-06-11. Mark Reid joined the Perf team. He will be working on &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/06/11/performance-update-issue-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>This is a post summarizing the activities of the Performance team over the past week. You can see the full weekly Engineering progress report for all teams here: <a href="https://wiki.mozilla.org/Platform/2013-06-11">https://wiki.mozilla.org/Platform/2013-06-11</a>.</em></p>
<ul>
<li>Mark Reid joined the Perf team. He will be working on the Telemetry backend reboot</li>
<li>Dhaval Giani joined the Perf team as a summer intern. Dhaval is a Master&#8217;s student at the University of Toronto where he works on detecting bugs in applications of RCU locking. Dhaval&#8217;s first internship project is storing Firefox caches in volatile (purgeable) memory on Android &amp; B2G (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=748598" rel="nofollow">bug 748598</a>?)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867757" rel="nofollow">bug 867757</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867762" rel="nofollow">bug 867762</a>: Aaron Klotz is extending the Gecko Profiler to support arbitrary annotations</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=881578" rel="nofollow">bug 881578</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=881575" rel="nofollow">bug 881575</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=879957" rel="nofollow">bug 879957</a>: I wrote a few small improvements to reduce startup I/O
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=880296" rel="nofollow">bug 880296</a>: We need to load fewer DLLs on startup</li>
</ul>
</li>
<li>Nathan Froyd is looking into improving Firefox startup on Android</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=813742" rel="nofollow">bug 813742</a>: Nathan is also working on parallelizing the reftest and crashtest suites</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=872421" rel="nofollow">bug 872421</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=880664" rel="nofollow">bug 880664</a>: Yoric landed a module loader for chrome workers</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=853388" rel="nofollow">bug 853388</a>: Irving &amp; Felipe continue to work on converting Addon Manager storage from SQLite to JSON, and moving its I/O off the main thread</li>
</ul>
<p>The team blogged about their work:</p>
<ul>
<li><strong>Avi</strong>: <a href="http://avih.github.io/blog/2013/06/10/tabstrip-4-vsync-and-newtab/">http://avih.github.io/blog/2013/06/10/tabstrip-4-vsync-and-newtab/</a></li>
<li><strong>Yoric</strong>: <a href="http://dutherenverseauborddelatable.wordpress.com/2013/06/05/project-async-responsive-issue-3/">http://dutherenverseauborddelatable.wordpress.com/2013/06/05/project-async-responsive-issue-3/</a></li>
<li><strong>Irving</strong>: <a href="http://www.controlledflight.ca/2013/05/31/saving-browser-state-asynchronously/">http://www.controlledflight.ca/2013/05/31/saving-browser-state-asynchronously/</a></li>
<li><strong>Julian Seward</strong>: <a href="https://blog.mozilla.org/jseward/2013/06/03/profiler-backend-news-3-june-2013/">https://blog.mozilla.org/jseward/2013/06/03/profiler-backend-news-3-june-2013/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/06/11/performance-update-issue-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Update, Issue #2</title>
		<link>http://blog.mozilla.org/vdjeric/2013/05/07/progress-on-performance-issue-2/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/05/07/progress-on-performance-issue-2/#comments</comments>
		<pubDate>Tue, 07 May 2013 19:04:54 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=140</guid>
		<description><![CDATA[This is my regularly scheduled post summarizing performance work from the past two weeks. Alternate title: Vlad&#8217;s Big Bowl of Performance Chilli The Performance team had its first monthly status meeting. We decided on projects and set goals &#38; timelines: &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/05/07/progress-on-performance-issue-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>This is my regularly scheduled post summarizing performance work from the past two weeks. Alternate title: Vlad&#8217;s Big Bowl of Performance Chilli<br />
</em></p>
<p>The Performance team had its first monthly status meeting. We decided on projects and set goals &amp; timelines: <a href="https://wiki.mozilla.org/Performance#Projects">wiki</a>. The next meeting is on Thursday, June 6th @ 11am PDT (Vidyo room &#8220;Performance&#8221;), people from other teams who are working on related projects will be invited.</p>
<p>Main thread I/O continues to be a major source of Firefox jank. To illustrate this point, I ran Nightly 23 with its profile stored on an SD card and captured a <a href="http://www.youtube.com/watch?v=XzSQS7sHgI8">screen recording</a>. The results were not pretty, as Firefox hung repeatedly during common actions (see <a href="https://blog.mozilla.org/vdjeric/2013/05/01/running-nightly-23-from-an-sd-card/">blog post</a>). Patrick McManus posted a band-aid patch (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=868441">bug 868441</a>) that will allow Firefox to by-pass the network cache when locking in the network cache is taking too long. The long-term solution is a <a href="https://wiki.mozilla.org/Necko/Cache/Plans/Draft_Proposal">network cache re-design</a>. Aaron Klotz and Joel Maher are working on detecting when new sources of main-thread I/O are added to the code in our test environment (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=644744">bug 644744</a>).</p>
<p>Drew Willcoxon wrote a patch to capture page thumbnails (for about:home) in the background (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=841495">bug 841495</a>). Once it&#8217;s hooked up, this will move the thumbnailing operation off the main thread and will allow Firefox to take snapshots of sites loaded without cookies to avoid capturing sensitive data.</p>
<p>Other fixes:</p>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=852467" rel="nofollow">bug 852467</a>: nsDisableOldMaxSmartSizePrefEvent runs on the gecko main thread, blocks for long periods of time</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649216" rel="nofollow">bug 649216</a>: Remove unnecessary delay when clicking tab close buttons sequentially</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=699331" rel="nofollow">bug 699331</a>: Reduce impact of font name enumeration at startup</li>
</ul>
<p>The team blogged about progress on their longer-term projects:</p>
<ul>
<li><a href="http://blog.mozilla.org/jseward/2013/04/30/profiler-backend-news-30-april-2013/" rel="nofollow">Julian Seward: Profiler backend news</a></li>
<li><a href="http://avih.github.io/blog/2013/05/06/tabstrip-animation-number-3/" rel="nofollow">Avi Halchmi: Tabstrip Animation Progress</a></li>
<li><a href="http://www.controlledflight.ca/2013/05/03/add-on-manager-progress/" rel="nofollow">Irving Reid: Add-On Manager Progress</a></li>
<li><a href="http://dutherenverseauborddelatable.wordpress.com/2013/04/26/project-async-responsive-issue-1/" rel="nofollow">David Teller: Project &#8220;Async &amp; Responsive&#8221; Progress</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/05/07/progress-on-performance-issue-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Running Nightly 23 from an SD card</title>
		<link>http://blog.mozilla.org/vdjeric/2013/05/01/running-nightly-23-from-an-sd-card/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/05/01/running-nightly-23-from-an-sd-card/#comments</comments>
		<pubDate>Thu, 02 May 2013 02:36:36 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=130</guid>
		<description><![CDATA[I&#8217;ve noticed that most Mozilla developers are using recent laptops with fast SSDs for their work. This observation shouldn&#8217;t be surprising, as developers tend to be tech enthusiasts with higher requirements, but I wonder if these fast machines could also &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/05/01/running-nightly-23-from-an-sd-card/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">I&#8217;ve noticed that most Mozilla developers are using recent laptops with fast SSDs for their work. This observation shouldn&#8217;t be surprising, as developers tend to be tech enthusiasts with higher requirements, but I wonder if these fast machines could also be masking some of the performance problems in the code we write?</p>
<p style="text-align: justify;">We&#8217;ve known for a while that I/O operations on the main thread are a major source of Firefox jank, but I think we sometimes under-estimate the urgency of refactoring the remaining sources of main-thread I/O. While Firefox might feel fast on powerful hardware, I believe a significant share of our users are still using relatively old hardware. For example <a href="https://groups.google.com/forum/?fromgroups=#!topic/mozilla.dev.planning/z6UB6fnmhKg">Firefox Health Report data</a> shows that 73.5% of our more-technically-inclined Beta users (Release channel data not yet available) are on a computer with 1 or 2 cores, including hyper-threaded cores.<strong> </strong></p>
<p style="text-align: justify;">Even<strong> </strong>when users are on modern machines, their storage systems might be slow because of hardware problems, I/O contention, data fragmentation, Firefox profiles/binaries being accessed over a network share, power-saving settings, slow laptop hard-drives, and so on. I think it would be beneficial to test certain types of code changes against slow storage by running Firefox from a network share, an SD card, or some other consistently slow I/O device.</p>
<h3 style="text-align: justify;">The Experiment</h3>
<p style="text-align: justify;">As an experiment to see what it&#8217;s like to run Firefox when I/O is consistently slow, I decided to create a Firefox profile on an SD card and surfed the web for a couple of hours, capturing profiles of jank along the way. I used an SD card which advertised maximum transfer rates of 20MB/s for  reads and 15MB/s for writes, although in practice, large transfers to and from the card peaked around 10MB/s. For reference, my mechanical hard drive performs the same operations an order of magnitude faster. I left the Firefox binaries on my hard drive &#8212; I was more interested in the impact of I/O operations that could be re-factored than the impact of Firefox code size.</p>
<p style="text-align: justify;">As I visited pages to set up the new Firefox profile with my usual customizations (extensions, pinned tabs, etc), I observed regular severe jank at every step. After entering the URL of a new site and hitting Enter, Firefox would become unresponsive and Windows would mark it as &#8220;Not Responding&#8221;. After about 5 seconds, it would start handling events again. Profiles showed that the network cache (currently being re-designed) was the most common source of these hangs. I also hit noticeable jank from other I/O bottlenecks when I performed common actions such as entering data into forms, logging into sites, downloading files, bookmarking pages, etc. Most of these issues are being worked on already, and I&#8217;m hopeful that this experiment will produce very different results in 6 months.</p>
<p style="text-align: justify;">This is a screen recording of a simple 5-minute browsing session. The janks shown in the video are usually absent when the profile is stored on my hard drive instead. You&#8217;ll need to listen to the audio to get all the details.</p>
<p><iframe src="https://www.youtube.com/embed/XzSQS7sHgI8?rel=0" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
<h3>Observations</h3>
<p style="text-align: justify;">The following is a selection of some of the I/O bottlenecks I encountered during my brief &amp; unrepresentative browsing sessions with this profile.</p>
<p style="text-align: justify;">1) Initializing a new profile takes a very long time. After first launch, even with the application binaries in the disk cache, Firefox did not paint anything for 20 seconds. It took an additional 5 seconds to show the &#8220;Welcome to Firefox&#8221; page. The &#8220;Slow SQL&#8221; section of about:telemetry showed ~40 SQL statements creating tables, indexes and views, with many taking multiple seconds each. To the best of my knowledge, there hasn&#8217;t been much research into improving profile-creation time recently. We discussed packing pre-generated databases into omni.jar a year ago (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=699615">bug 699615</a>).</p>
<p style="text-align: justify;">2) Installing extensions is janky. The new extension&#8217;s data is inserted into the addons.sqlite and extensions.sqlite DBs on the main thread. An equal amount of time is spent storing the downloaded XPI in the HTTP cache. See profile <a href="http://people.mozilla.com/~bgirard/cleopatra/#report=5b66bc0577f23524bdeedba3c56d2499906b342b">here</a>. Surprisingly, the URL classifier also calls into the HTTP cache, triggering jank.</p>
<p style="text-align: justify;">3) The AwesomeBar is pretty janky at first. It seems the Places DB gets cloned several times on the main thread.</p>
<p style="text-align: justify;">4) Unsurprisingly, startup &amp; shutdown are slower, especially if the Add-on Manager has to update extension DBs or if extensions need to do extra initialization or cleanup. For example, AdBlock triggers main-thread I/O shortly after startup by loading the AdBlock icon from its XPI into the browser toolbar.</p>
<p>5) New bugs/bugs needing attention:</p>
<ul>
<li>The URL classifier opens/writes/closes &#8220;urlclassifierkey3.txt&#8221; on the main thread. Filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867776">bug 867776</a></li>
<li>The cookie DB is closed on the main-thread after being read into memory. Filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867798">bug 867798</a></li>
<li>The startupCache file might be another good candidate for read-ahead. Filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=867804">bug 867804</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818725">bug 818725</a>: localStore.rdf is fsync&#8217;ed on the main thread during GC . Not completely new, but this bug could use some attention</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=789945">bug 789945</a>: Preferences are flushed &amp; fsynced on the main thread several times during a session and they can cause noticeable jank. They also show up frequently in chrome hangs.</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=833545">bug 833545</a>: Telemetry eagerly loads saved pings on the main thread</li>
</ul>
<p>6) Known issues observed during browsing:</p>
<ul>
<li>Network cache creates a ton of jank when storage is slow/contended</li>
<li>Password Manager, Form History, Places and Download Manager do main-thread I/O</li>
<li>SQLite DBs cause jank when opened on the main-thread</li>
<li>Font loading causes jank</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/05/01/running-nightly-23-from-an-sd-card/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>A Quick Update on Snappy Progress</title>
		<link>http://blog.mozilla.org/vdjeric/2013/04/24/a-quick-update-on-snappy-progress/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/04/24/a-quick-update-on-snappy-progress/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 17:13:38 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=125</guid>
		<description><![CDATA[The Performance team has retired the Snappy name, and the individual project leads are now blogging their projects&#8217; progress instead of Taras doing regular Snappy blog posts. However, I think there might still be some interest in seeing the performance &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/04/24/a-quick-update-on-snappy-progress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The Performance team has <a href="http://taras.glek.net/blog/2013/03/27/snappy-number-55-snappy-evolution/">retired the Snappy name</a>, and the individual project leads are now blogging their projects&#8217; progress instead of Taras doing regular Snappy blog posts.</p>
<p>However, I think there might still be some interest in seeing the performance improvements summarized in one place, and since I&#8217;m already doing Performance team updates at the <a href="https://wiki.mozilla.org/Platform/">Platform meeting</a>, I thought I would try my hand at regularly blogging about ongoing performance work.</p>
<p>So without further ado, these are a few highlights from the past 2 weeks:</p>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859558" rel="nofollow">bug 859558</a>: John Daggett is working on eliminating font jank. The font bugs currently tracked in this meta-bug are top offenders according to <a href="https://blog.mozilla.org/vdjeric/2013/04/09/current-state-of-firefox-chrome-hangs/">chrome-hang reports</a>.</li>
<li>Honza Bambas wrote a <a href="https://wiki.mozilla.org/Necko/Cache/Plans/Draft_Proposal" rel="nofollow">draft proposal</a> for a new network cache design. The locking in the current network cache is a common source of Firefox jank.</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=830492" rel="nofollow">bug 830492</a>: Gregory Szorc changed SQLite behavior in FHR to require fewer fsyncs</li>
<li>Kyle Lahnakoski developed a <a href="https://metrics.mozilla.com/bugzilla-analysis/Telemetry%20-%20Test.html" rel="nofollow">tool</a> for comparing Telemetry simple measures. This tool is in the prototype stage and is currently only being used to look for correlations between slow startups and other Telemetry variables (more on that in another blog post). Since Kyle &amp; I are currently the only users of this tool, the page is only accessible from Mozilla&#8217;s Toronto network. You will also have to disable <a href="https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/">mixed-content protection</a> on the page.</li>
</ul>
<p>A recent bug affected Telemetry submission rates on Firefox 21, 22, and 23 for several weeks. It has since been resolved (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=844331" rel="nofollow">bug 844331</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=862599" rel="nofollow">bug 862599</a>), but you&#8217;ll need to exercise caution when interpreting dashboard results from the affected time period. Specifically, you may want to exclude data from time periods with relatively few Telemetry submission counts.</p>
<p>Finally, there were several blog posts from the individual project leads:</p>
<ul>
<li><a href="http://dutherenverseauborddelatable.wordpress.com/2013/04/10/announcing-project-async-responsive/" rel="nofollow">David Teller announced project &#8220;Async &amp; Responsive&#8221;</a></li>
<li><a href="http://avih.github.io/blog/2013/04/14/tabstrip-project-intro/" rel="nofollow">Avi Halachmi blogged about the &#8220;Tabstrip Animation Project&#8221;</a> and <a href="http://avih.github.io/blog/2013/04/15/tabstrip-animation-progress-vsync/" rel="nofollow">his recent progress</a></li>
<li><a href="http://www.controlledflight.ca/" rel="nofollow">Irving Reid is changing the Addon Manager&#8217;s storage format</a></li>
<li><a href="https://blog.mozilla.org/nfroyd/2013/04/18/cold-page-load-os-x-10-7-and-talos/" rel="nofollow">Nathan Froyd looked at Talos pageload benchmark data</a></li>
<li><a href="https://blog.mozilla.org/jseward/" rel="nofollow">Julian Seward published an update on native stack unwinding</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/04/24/a-quick-update-on-snappy-progress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Current state of Firefox chrome hangs</title>
		<link>http://blog.mozilla.org/vdjeric/2013/04/09/current-state-of-firefox-chrome-hangs/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/04/09/current-state-of-firefox-chrome-hangs/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 06:42:35 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=119</guid>
		<description><![CDATA[This post summarizes the top &#8220;chrome hangs&#8221; reported to Telemetry by Nightly 22 on Windows during the first half of March. A &#8220;chrome hang&#8221; is a period of time during which the main thread is stuck processing a single event. &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/04/09/current-state-of-firefox-chrome-hangs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">This post summarizes the top &#8220;chrome hangs&#8221; reported to Telemetry by Nightly 22 on Windows during the first half of March.</p>
<p style="text-align: justify;">A &#8220;chrome hang&#8221; is a period of time during which the main thread is stuck processing a single event. It is not a permanent hang. By default, Nightly on Windows reports any chrome hangs lasting at least 5 seconds to Telemetry. You can see your own chrome hangs from your current browsing session in your Nightly&#8217;s <em>about:telemetry</em> page.</p>
<h3 style="text-align: justify;">Data set</h3>
<p style="text-align: justify;">There are roughly 270,000 Firefox sessions with chrome hangs in this data set, reporting a total of ~570,000 chrome hang stacks. There are 84,000 &#8220;unique&#8221; stack signatures, but the heuristic I use for stack signature generation is far from perfect.</p>
<p style="text-align: justify;">The top hangs:</p>
<ol style="text-align: justify;">
<li><a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top100.txt">Top 100 stack signatures</a></li>
<li><a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top50_Without_PluginHangs.txt">Top 50 signatures, excluding plugin hangs</a><strong><span style="color: #ff0000;">*</span></strong></li>
<li><a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top50_Without_CommonHangTypes.txt">Top 50 signatures, excluding plugin, GC, CC, HTTP cache, font, or content hangs</a><strong><span style="color: #ff0000;">*</span></strong></li>
</ol>
<p style="text-align: justify;"><strong><span style="color: #ff0000;">*</span></strong> <em>I removed JS-only stacks that did not contain any useful identifying frames</em></p>
<h3 style="text-align: justify;">TOP CAUSES OF CHROME HANGS</h3>
<p style="text-align: justify;">The raw chrome hang data is challenging to categorize perfectly since there is a very long tail of stack signatures.</p>
<p style="text-align: justify;">Instead, I used a simple heuristic to categorize the stacks, and I found that hang stacks involving plugins are by far the most common (36% of hangs), stacks with font operations are second (12%), GC and CC are third (10%), and the HTTP cache is fourth (4%). The long-tail of &#8220;other&#8221; operations makes up the remaining 38% of the data.</p>
<p style="text-align: justify;">After filtering the data set to only the top 100 most common hang signatures, I found the distribution of hangs mostly unchanged. Most of the hangs are again caused by plugins: 53 out of the top 100 signatures are plugins (67% by number of hangs). Font-loading operations take second place (11% by number of hangs), followed by GC and CC (9%) and locking in the HTTP cache (4%). The remaining 9% of hangs is mostly made up of long-running JavaScript scripts. Unfortunately, the chrome hang reporting code currently does not  walk the JavaScript stack, so it&#8217;s impossible to obtain useful information out of pure JavaScript hangs.</p>
<p style="text-align: justify;"><strong>Data:</strong> <a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top100.txt">Top 100 chrome hang stack signatures</a></p>
<h3 style="text-align: justify;">The plugin problem</h3>
<p style="text-align: justify;">We&#8217;ve known for a while that plugins are a major source of browser unresponsiveness. In particular, the initial synchronous load of the plugin&#8217;s library and the creation of a new plugin instance are the most common hang stacks. The top 100 list also shows plugins taking a long time to handle events and destroy plugin instances. There is also a large number of stacks where Flash hangs cause Firefox hangs on account of Windows input queue synchronization (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818059">bug 818059</a>).</p>
<p style="text-align: justify;">Since we&#8217;re stuck with the synchronous NPAPI, I suspect we won&#8217;t be able to minimize the impact of of plugin hangs until we separate content and chrome into separate processes (i.e. the Electrolysis project). In the short term, we&#8217;re mitigating some of the plugin pains by adding read-ahead to improve plugin library loading speed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=836488">bug 836488</a>) and starting with Firefox 20, we&#8217;re showing users a UI that allows them to terminate an unresponsive plugin after 11 seconds (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=805591">bug 805591</a>). Both of these patches were written by Aaron Klotz.</p>
<p style="text-align: justify;">Benoit Girard, Georg Fritzsche and Benjamin Smedberg are working on uncovering the causes of some of these hangs by adding profiling support to the plugin-container.exe process (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=853358">bug 853358</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=734691">bug 734691</a>) and exposing IPC message information to the profiler (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=853864">bug 853864</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=853363">bug 853363</a>). You can find Benoit&#8217;s write-up <a href="http://benoitgirard.wordpress.com/2013/03/25/profiler-snappy-work-week/">here</a>.</p>
<p style="text-align: justify;">Finally, it might also be possible to move some of the heavy plugin operations off the main thread (e.g. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=856743">bug 856743</a>).</p>
<h3 style="text-align: justify;">OTHER CAUSES</h3>
<p style="text-align: justify;">After plugins, <strong>font loading operations </strong>are the most frequent single category of browser hangs. To see an example of a fonts hang, restart your computer (or clear your OS disk cache by other means) and load the Wikipedia homepage (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=832546">bug 832546</a>). You should see a hang lasting at least 100ms (depending on your storage device) while the browser loads dozens of fonts from disk to render all the different languages displayed on the page.</p>
<p style="text-align: justify;">There are several existing bugs for font hangs (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=734308">bug 734308</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=699331">bug 699331</a>), but I&#8217;d like to ask someone with some knowledge of  the fonts code to file individual bugs for the rest. I filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859558">bug 859558</a> as a catch-all bug for all the font stacks that I did not recognize.</p>
<p style="text-align: justify;"><strong>Data:</strong> <a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top50_Without_PluginHangs.txt">Top 50 chrome hang stack signatures, excluding plugin hangs<strong></strong></a></p>
<p style="text-align: justify;">After plugins and fonts, the locking done in the <strong>HTTP network cache</strong> causes most of the chrome hangs.  It seems the main thread often gets blocked waiting on a lock that is being held by a background cache thread. I assume the background thread is doing disk I/O while holding the contended lock. If you move your Firefox profile to a slow a storage device (e.g. an SD card), you can reliably reproduce these hangs by visiting new sites. The Necko team is currently working on plans for a <a href="https://wiki.mozilla.org/Necko/Cache/Plans">new network cache design</a>.</p>
<p style="text-align: justify;"><strong>Garbage Collection</strong> <strong>&amp; Cycle Collection</strong> are the third most common category of hangs. Surprisingly, incremental GC stacks also show up in the top 50.</p>
<h3 style="text-align: justify;">OTHER HANGS</h3>
<p style="text-align: justify;">In addition to the hangs described above, there is a significant number of  stacks with JIT-ed JavaScript code, page reflows and other content operations. Since chrome hangs don&#8217;t report the names of JavaScript functions on the stack and Telemetry doesn&#8217;t collect page URLs, these stacks are not useful.  I filtered out these types of stacks and came up with a list of the top 50 &#8220;other&#8221; hangs.</p>
<p style="text-align: justify;"><strong>Data:</strong> <a href="http://people.mozilla.com/~vdjeric/march_chromehangs/Top50_Without_CommonHangTypes.txt">Top 50 chrome hang stack signatures, excluding common hang types</a> (plugins, GC, CC, HTTP cache, font, content hangs<strong></strong>)</p>
<p style="text-align: justify;">This list shows:</p>
<ul>
<li>The JavaScript debugger frequently causes chrome hangs</li>
<li>JavaScript calls an nsIDNSService interface function that synchronously resolves DNS names. Could we deprecate use of this function on the main thread?</li>
<li>Switching graphics to hardware-accelerated mode after startup (filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859652">bug 859652</a>) and Direct3D device initialization (filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859664">bug 859664</a>) causes hangs</li>
<li>Printing causes hangs (filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859655">bug 859655</a>)</li>
<li>JavaScript functions called by nsContentPolicy::ShouldLoad take a long time to return</li>
<li>DOM workers can take a long time to return the amount of memory in use (filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=859657">bug 859657</a>)</li>
<li>Extension and chrome JavaScript uses nsLocalFile for main thread I/O. Some of the main-thread calls to nsLocalFile::Exists might be TestPilot main-thread I/O (filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=856867">bug 856867</a>)</li>
<li>Proxy resolution jank doesn&#8217;t seem to have been completely fixed (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=781732">bug 781732</a>)</li>
<li>Destroying CSS style sheets takes a long time (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819489">bug 819489</a>)</li>
<li>nsSafeFileOutputStream is used on the main thread, blocking the main thread with fsyncs and other file I/O</li>
<li>JSON stringify is sometimes called on very large objects</li>
<li>Main-thread SQL is a common source of hangs, e.g. nsNavBookmarks::QueryFolderChildren, nsAnnotationService::GetPageAnnotationString, nsDownload::UpdateDB</li>
<li>JAR files are opened and closed from the main thread causing hangs</li>
</ul>
<p>I have not identified all of the hangs in this top list:</p>
<ul>
<li>nsCryptoHash::UpdateFromStream is called from the main thread with a file stream input. I haven&#8217;t found the source of this</li>
<li>A timer callback evals a string and calls js::SourceCompressorThread::waitOnCompression which causes hangs</li>
<li>nsIncrementalDownload::OnDataAvailable writes downloaded data to disk on the main thread</li>
<li>nsExternalAppHandler::SaveToDisk moves files on the main thread (known isssue?)</li>
</ul>
<h3>Conclusion</h3>
<p style="text-align: justify;">Plugins are the foremost cause of Firefox janks lasting multiple seconds. Fonts, GC/CC, and the HTTP network cache are also common sources. The long tail of hang signatures contains new bugs, some of which could be fixed quickly.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/04/09/current-state-of-firefox-chrome-hangs/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Add-on performance problems</title>
		<link>http://blog.mozilla.org/vdjeric/2013/01/24/add-on-performance-problems/</link>
		<comments>http://blog.mozilla.org/vdjeric/2013/01/24/add-on-performance-problems/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 04:13:29 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=102</guid>
		<description><![CDATA[NOTE TO READERS: I wrote this post to draw attention to a common pitfall when using SQLite DBs in extension and Mozilla code. I am not suggesting people stop using the addons mentioned below. The list of top sources of &#8230; <a href="http://blog.mozilla.org/vdjeric/2013/01/24/add-on-performance-problems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong><span style="color: #ff0000;">NOTE TO READERS:</span></strong><span style="color: #000000;"> I wrote this post to draw attention to a common pitfall when using SQLite DBs in extension and Mozilla code. I am <span style="text-decoration: underline;">not</span> suggesting people stop using the addons mentioned below. The list of top sources of slow SQL is skewed by various factors: more popular add-ons are more likely to be in this list, add-ons that do slow operations against their own DBs will be in the list but add-ons that do slow operations against Firefox DBs will not, etc etc.</span></p>
<hr />
<p>The perf team has been using Telemetry data to find and fix performance problems in Firefox code, but the same data can also be used to find performance problems in add-ons.</p>
<p>The Telemetry data on long-running SQL statements, in particular, contains information about slow SQL operations carried out by add-ons. The aggregated reports are publicly accessible from the <a href="https://metrics.mozilla.com/">Metrics dashboard</a>  (BrowserID account needed). If you navigate to the slow SQL section or click on <a href="http://tinyurl.com/bzwvv97">this link directly</a>, you will see stats on SQL statements that took longer than 100ms to execute on the main thread across at least 100 browsing sessions. In general, main thread I/O (including SQL) is a major performance problem in Firefox as the duration of I/O operations is essentially unbounded and any long running operation on the main thread causes browser unresponsiveness. As a privacy precaution, Telemetry never reports statement parameters and only reports the name of the DB if the SQL was executed against an extension DB. Note that the dashboard doesn&#8217;t specify whether an SQL string was executed by Firefox or add-on code, but SQL executed against extension DBs has the form &#8220;Untracked SQL for &lt;<em>extension DB name</em>&gt;.sqlite&#8221;. As can be seen from that dashboard, the majority of main-thread SQL work is still coming from Mozilla code, but addon SQL is well represented.</p>
<p>These are the top 20 addons doing main thread DB work<span style="color: #ff0000;">*</span>, found by sorting the slow SQL table on frequency (&#8220;Total Doc&#8221;):</p>
<ol>
<li>Various extensions which use the customizable <a href="http://toolbar.conduit.com/">Conduit.com toolbar code.</a> These toolbars sometimes ship with malware, but they also seem to be used in legitimate AMO extensions</li>
<li>The popular <a href="https://addons.mozilla.org/en-us/firefox/addon/forecastfox-weather/">ForecastFox</a> weather extension</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/fast-dial-5721/">Fast Dial</a> visual bookmarks</li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/evernote-web-clipper/">Evernote Web Clipper</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/zotero/">Zotero</a> research tool</li>
<li>Mail.ru <a href="http://sputnik.mail.ru/">toolbar</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/webde-mailcheck/">Web.de MailCheck</a> + <a href="https://addons.mozilla.org/en-US/firefox/addon/mailcom-mailcheck/">Mail.com MailCheck</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/yoono-twitter-facebook-linkedi/">Yoono sidebar</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/yandexbar/">Yandex toolbar</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/lazarus-form-recovery/">Lazarus</a> form data recovery</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/downthemall/">DownThemAll!</a> downloader</li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/xmarks-sync/">Xmarks Sync</a> bookmarking</li>
<li>Various extensions using <a href="http://brandthunder.com/">Brand Thunder</a> themes code</li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/video-downloader-player/">Ant Video Downloader</a></li>
<li><a href="https://addons.mozilla.org/EN-US/firefox/addon/truste-tracker-protection/">TRUSTe Tracker Protection</a></li>
<li>a DB which might be associated with <a href="https://addons.mozilla.org/en-us/firefox/addon/privacysuite/">PrivacySuite</a> and <a href="https://addons.mozilla.org/en-US/firefox/addon/targeted-advertising-cookie-op/">Targeted Advertising Cookie Opt-Out</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/gmail-checker/">GMail Checker</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/brief/">Brief</a> RSS reading</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/screenshot-pimp-screengrab-scr/">Screenshot Pimp</a> + <a href="https://addons.mozilla.org/en-US/firefox/addon/mediapimp-internet-radio-save-/">MediaPimp</a> + <a href="https://addons.mozilla.org/en-US/firefox/addon/facebook-friend-request-notifi/">Notifications [...] for Facebook</a></li>
<li><a href="https://addons.mozilla.org/en-us/firefox/addon/form-history-control/">Form History Control</a></li>
</ol>
<p>* The top offender is actually SQL executed against &#8220;cache.sqlite&#8221;. This is the name of the DB used by the <a href="https://addons.mozilla.org/en-US/thunderbird/addon/lightning/">Lightning</a> calendaring addon for Thunderbird. Its inclusion in the Firefox SQL list might be a bug in the dashboard or it might be an intentionally misleading name for a spyware DB. There were other highly ranked DBs I could not identify: addonstat.sqlite, store-pp.sqlite, livemargins_appcenter.sqlite, database.sqlite.</p>
<p>We will need a joint effort between Mozilla developers and add-on authors to make Firefox snappier for users. Our next step is to reach out to the authors of the above addons and ask them to change how they use SQLite DBs. We&#8217;ll also need to improve our <a href="https://developer.mozilla.org/en-US/docs/Extensions/Performance_best_practices_in_extensions">documentation</a> on best-practices for extension developers.</p>
<p><strong><span style="color: #ff0000;">UPDATE:</span></strong> A few commenters pointed out that I never mentioned the async SQL APIs in my post. Indeed, developers should be using the asynchronous APIs to execute SQL statements off the main thread: <a href="https://developer.mozilla.org/en-US/docs/Storage#Asynchronously">https://developer.mozilla.org/en-US/docs/Storage#Asynchronously</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2013/01/24/add-on-performance-problems/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Snappy #46: December Progress</title>
		<link>http://blog.mozilla.org/vdjeric/2012/12/25/snappy-46-december-progress/</link>
		<comments>http://blog.mozilla.org/vdjeric/2012/12/25/snappy-46-december-progress/#comments</comments>
		<pubDate>Tue, 25 Dec 2012 23:43:38 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=92</guid>
		<description><![CDATA[Taras is on vacation this month, so I&#8217;m filling in with a Snappy progress update. Taras also has a mini-update on his new blog: Snappy #45: The View From Home. We are working hard on improving Firefox start up and &#8230; <a href="http://blog.mozilla.org/vdjeric/2012/12/25/snappy-46-december-progress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Taras is on vacation this month, so I&#8217;m filling in with a Snappy progress update. Taras also has a mini-update on his new blog: <a href="http://taras.glek.net/blog/2012/12/21/interesting-bugzilla-activity/">Snappy #45: The View From Home</a>.</p>
<p>We are working hard on improving Firefox <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=810156">start up</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=819063">shut down</a> and much of the work is being done with the help of the new startup &amp; shutdown profiling modes in <a href="https://github.com/bgirard/Gecko-Profiler-Addon/">Benoit Girard&#8217;s profiler</a>. In general, we are finding that GC and CC make up a significant fraction of shutdown time. The ongoing <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=662444">exit(0)</a> project is going to be the biggest win for shutdowns, but startup times will likely require many smaller improvements. We also seem to be up against against a gradual and relentless increase in startup times with each release (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818257">bug 818257</a>). This may be a consequence of increased code size and our decision to load all of xul.dll on startup.</p>
<p>Over the past month, several patches have landed aiming to improve startup times, but we can&#8217;t quantify the user benefits until the server-side bucketing of Telemetry measurements becomes more fine-grained (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=778809">bug 778809</a>). David Teller made improvements to startup by moving the reading of the session file (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=532150">bug 532150</a>) and the search bar metadata (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=760036">bug 760036</a>) off the main thread. Aaron Klotz landed a patch <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=810101">(bug 810101)</a> to read the SafeBrowsing<em> .sbstore</em> and <em>.cache</em> files with the &#8220;read-ahead&#8221; flag. These files total several megabytes and Aaron&#8217;s local testing showed a 50ms reduction in file read times. He also discovered that the .<em>sbstore</em> files get read shortly after startup when we first try to open an HTTP channel.</p>
<p>On the shutdown side, Benoit Girard landed code to skip the destruction of cross-compartment wrappers during exit (<a href="https://bugzilla.mozilla.org/buglist.cgi?quicksearch=818296">bug 818296</a>). He also landed another change <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=816656">(bug 816656)</a> to prevent flushing of the startup cache to disk while shutting down a brief session. Olli Pettay&#8217;s <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=818739">bug 818739</a> stopped the Cycle Collector from being run on shutdown in non-debug builds.</p>
<p>There were also a couple of general responsiveness patches deserving mention: Vladimir Vukicevic landed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=731974">bug 731974</a> which promises to considerably improve the smoothness of UI animations, Rafael Espindola moved the reading of a Telemetry data file off the main thread (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=815709">bug 815709</a>) and Drew Willcoxon refactored the content pref service to use async storage (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=699859">bug 699859</a>).</p>
<p>James Abbatiello, an external contributor, wrote an extension to track tab switch times to help us identify pages we don&#8217;t handle well. The extension adds the last switch time (in milliseconds) to tab titles and shows a full list in an &#8220;about:tabswitch&#8221; page.  If you&#8217;re interested in helping us identify problematic pages, install the <a href="https://addons.mozilla.org/en-US/firefox/addon/add-on-builder-helper/">Addon Builder Helper</a> and the <a href="https://builder.addons.mozilla.org/package/162308/">current draft of James&#8217;s extension</a> and consider filing bugs for any URLs which consistently require more than 50ms.</p>
<p>Lastly, I moved <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807021">LocalStorage writes off the main thread,</a> which ought to provide a relief from a major source of UI unresponsiveness.  LocalStorage has been a top source of slow main-thread SQL for a long time: <a href="http://bit.ly/WEOwPC">http://bit.ly/WEOwPC</a> (sort &#8220;Latest Changes&#8221; section by &#8220;Total Sum&#8221; column). Honza Bambas is working on a full re-write of LocalStorage <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=600307">(bug 600307)</a> which also adds pre-fetching.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2012/12/25/snappy-46-december-progress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>New about:telemetry page in Firefox 19</title>
		<link>http://blog.mozilla.org/vdjeric/2012/11/25/new-abouttelemetry-page-in-firefox-19/</link>
		<comments>http://blog.mozilla.org/vdjeric/2012/11/25/new-abouttelemetry-page-in-firefox-19/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 02:15:23 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=81</guid>
		<description><![CDATA[Firefox 19 now has a built in &#8220;about:telemetry&#8221; page which displays the data gathered by the &#8220;Telemetry&#8221; system. If the user has opted in, Telemetry will gather information about Firefox performance, hardware, usage and customizations and submit it to Mozilla. &#8230; <a href="http://blog.mozilla.org/vdjeric/2012/11/25/new-abouttelemetry-page-in-firefox-19/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Firefox 19 now has a built in &#8220;about:telemetry&#8221; page which displays the data gathered by the &#8220;Telemetry&#8221; system. If the user has opted in, Telemetry will gather information about Firefox performance, hardware, usage and customizations and submit it to Mozilla. The information in the about:telemetry page is meant to inform users about the data being sent to Mozilla, but it can also help technical users report performance bugs to Mozilla.</p>
<p>For example, the &#8220;Slow SQL Statements&#8221; section identifies slow SQLite operations which have caused Firefox &#8220;jank&#8221; (temporary hangs):</p>
<p><a href="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetrySQL.png"><img class="alignnone  wp-image-83" title="about:telemetry Slow SQL Statements" src="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetrySQL-300x251.png" alt="about:telemetry &quot;Slow SQL Statements&quot; section" width="300" height="251" /></a></p>
<p>In Nightly builds which support profiling, the &#8220;Browser Hangs&#8221; section will show call stacks from the main thread whenever it took longer than 5 seconds to process an event. Clicking on &#8220;Fetch function names for hang stacks&#8221; converts the stack PCs to human-readable function names:</p>
<p><a href="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetryHangs.png"><img class="alignnone  wp-image-84" title="about:telemetry Browser Hangs" src="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetryHangs-300x251.png" alt="about:telemetry &quot;Browser Hangs&quot; section" width="300" height="251" /></a></p>
<p>The Histograms sections contains various performance and usage measures expressed in histogram form. The histogram data is primarily intended for Firefox developers, but the brave can look up the histogram definitions in <a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Histograms.json" target="_blank">Histograms.json</a> and compare their own values to the Firefox population using the <a href="https://metrics.mozilla.com/data/" target="_blank">Telemetry Dashboard</a>.</p>
<p><a href="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetryHistograms.png"><img class="alignnone  wp-image-85" title="about:telemetry Histograms" src="http://blog.mozilla.org/vdjeric/files/2012/11/aboutTelemetryHistograms-300x254.png" alt="about:telemetry &quot;Histograms&quot; section" width="300" height="254" /></a></p>
<p>I invite you to leave a comment or file a bug if there are any changes you would like to see made to the about:telemetry page to make it more useful for you.</p>
<p>Please note that the old <a href="https://addons.mozilla.org/en-us/firefox/addon/abouttelemetry/" target="_blank">about:telemetry</a> extension has been obsoleted by the built-in page and that the extension is now marked incompatible with Firefox 19+.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2012/11/25/new-abouttelemetry-page-in-firefox-19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cache, plugin, font operations most common in chrome hang reports</title>
		<link>http://blog.mozilla.org/vdjeric/2012/06/08/cache-plugin-font-operations-most-common-in-chrome-hang-reports/</link>
		<comments>http://blog.mozilla.org/vdjeric/2012/06/08/cache-plugin-font-operations-most-common-in-chrome-hang-reports/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 03:18:04 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=75</guid>
		<description><![CDATA[A few months ago, in bug 712109, I added functionality for reporting temporary main thread hangs to Telemetry and recently I obtained the first batch of reports. Hang reporting works by monitoring the event loop for inactivity &#8212; if the &#8230; <a href="http://blog.mozilla.org/vdjeric/2012/06/08/cache-plugin-font-operations-most-common-in-chrome-hang-reports/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A few months ago, in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=712109">bug 712109</a>, I added functionality for reporting temporary main thread hangs to Telemetry and recently I obtained <a href="https://metrics.mozilla.com/projects/browse/METRICS-663">the first batch</a> of reports. Hang reporting works by monitoring the event loop for inactivity &#8212; if the event loop has not started processing a new event for 10 seconds, then the hang monitor will capture a snapshot of the main thread&#8217;s call stack and attach the addresses to the next Telemetry report along with the measured duration of the hang. The default minimum hang duration is 10 seconds, but this value is configurable through the <em>hangmonitor.timeout</em> preference. The chrome hang reporter only captures a single snapshot of the call stack, so the captured stack may not always be representative of all of Firefox&#8217;s activities during the hang. Generally, it is enough to identify the offending code.</p>
<h3>The Hang Reporter Population</h3>
<p>Over the 2-month period covered by this batch of data, there were only 42 Telemetry reports containing chrome hangs. This is because hang reporting is only enabled on the <em>nightly-profiling</em> branch as it requires frame pointers for  unwinding the call stack. Additionally, there aren&#8217;t many users on the nightly-profiling branch &#8212; in fact, yesterday, there were only 14 unique Telemetry submissions by users of the <em>nightly-profiling</em> branch.  Further, we currently don&#8217;t save chrome hangs in persistent Telemetry, so some of the reports were likely lost during browser restarts (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=763113">bug 763113</a>).</p>
<p>Some details immediately jumped out of the hang report data:</p>
<ul>
<li>The median hang duration is 20 seconds.</li>
<li>Two underpowered hardware configurations kept popping up in the hang reports, so these two users are over-represented in the data. Together, they contributed 25 of the 42 Telemetry reports.</li>
<li>Most Telemetry pings with a chrome hang have only a single hang, but some reports have as many as 10 hangs during a single browsing session.</li>
</ul>
<p>In order to symbolicate the PCs in the hang reports, we rely on Breakpad symbols. Unfortunately, it seems that symbols for nightly builds are deleted after 30 days, so most of the hangs from April and early May can not be symbolicated. That left 17 Telemetry pings out of 42 whose hangs could be symbolicated. Going forward, the plan is to automate this process and have symbolication done every day (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=763116">bug 763116</a>).</p>
<p>I think it would also make sense to lower the hang threshold (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=763124">bug 763124</a>). A threshold of 5 seconds likely wouldn&#8217;t overwhelm the Metrics servers even if we deployed hang reporting on the regular nightly channel and it would allow us to detect more subtle performance issues.</p>
<h3>TOP HANGS</h3>
<h4>Cache Operations</h4>
<p>Out of the 33 symbolicated hang stacks, call stacks ending with cache operations are the most common (12 hang stacks). A variety of cache operations are represented in these stacks:</p>
<ul>
<li>nsCacheEntryDescriptor::GetMetaDataElement <strong>x3</strong></li>
<li>nsCacheEntryDescriptor::GetStoragePolicy <strong>x3</strong></li>
<li>nsCacheEntryDescriptor::GetDeviceID <strong>x2</strong></li>
<li>nsCacheEntryDescriptor::Release <strong>x2</strong></li>
<li>nsCacheEntryDescriptor::GetExpirationTime<strong> x2</strong></li>
</ul>
<p>All of the stacks were reported by a single Windows XP machine, however the reports are over the span of a week and this machine is responsible for almost half of the hang stacks in the entire data set. I think these stacks are a good argument for devoting additional resources to investigating and improving the performance of our caching mechanisms.</p>
<h4>Plugins</h4>
<p>The second most common category of hangs are those involving plugins: loading plugins, destroying plugins, setting the window for a plugin and scripting plugins. In each of these cases, the main thread gets stuck waiting for the plugin running in the plugin-container process. It&#8217;s not possible to identify the plugin using only the callstack and unfortunately, we currently don&#8217;t collect the list of installed plugins.</p>
<h4>GetFontTable</h4>
<p>There were 2 hangs reported while getting font tables. I&#8217;ve also recently personally witnessed brief hangs lasting a couple of seconds while fetching the font list. I filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=763134">bug 763134</a>.</p>
<p>Excerpt from a sample hang, lasting 16 seconds:</p>
<pre>KiFastSystemCallRet (in ntdll.dll)
GDIFontEntry::GetFontTable(unsigned int,FallibleTArray&lt;unsigned char&gt; &amp;) (in xul.dll)
GDIFontEntry::ReadCMAP() (in xul.dll)
gfxFontFamily::ReadAllCMAPs() (in xul.dll)
gfxPlatformFontList::RunLoader() (in xul.dll)
gfxFontInfoLoader::LoaderTimerFire() (in xul.dll)
gfxFontInfoLoader::LoaderTimerCallback(nsITimer *,void *) (in xul.dll)
nsTimerImpl::Fire() (in xul.dll)
...</pre>
<h4>GC</h4>
<p>The data set contained two hangs where GC took 15 seconds and 31 seconds, and another hang where GC took 24 seconds but it also encompassed destructing an HTML document.</p>
<h4>Gradients</h4>
<p>There was a single Telemetry report containing 10 chrome hangs with very similar hang stacks of about ~30 seconds each. All of the stacks had to do with painting gradients via D2D. I think this issue might already be covered in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=750871">bug 750871</a>.</p>
<pre>DrawingContext::FillRectangle(D2D_RECT_F const *,ID2D1Brush *) (in d2d1.dll)
D2DRenderTargetBase&lt;ID2D1BitmapRenderTarget&gt;::FillRectangle(D2D_RECT_F const *,ID2D1Brush *) (in d2d1.dll)
_cairo_d2d_fill (in gkmedias.dll)
_cairo_gstate_fill (in gkmedias.dll)
_moz_cairo_fill_preserve (in gkmedias.dll)
nsCSSRendering::PaintGradient(nsPresContext *,nsRenderingContext &amp;,nsStyleGradient *,nsRect const &amp;,nsRect const &amp;,nsRect const &amp;) (in xul.dll)
nsImageRenderer::Draw(nsPresContext *,nsRenderingContext &amp;,nsRect const &amp;,nsRect const &amp;,nsPoint const &amp;,nsRect const &amp;) (in xul.dll)
nsCSSRendering::PaintBackgroundWithSC(nsPresContext *,nsRenderingContext &amp;,nsIFrame *,nsRect const &amp;,nsRect const &amp;,nsStyleContext *,nsStyleBorder const &amp;,unsigned int,nsRect *) (in xul.dll)
nsCSSRendering::PaintBackground(nsPresContext *,nsRenderingContext &amp;,nsIFrame *,nsRect const &amp;,nsRect const &amp;,unsigned int,nsRect *) (in xul.dll)
nsDisplayCanvasBackground::Paint(nsDisplayListBuilder *,nsRenderingContext *) (in xul.dll)
mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer *,gfxContext *,nsIntRegion const &amp;,nsIntRegion const &amp;,void *) (in xul.dll)
mozilla::layers::ThebesLayerD3D10::DrawRegion(nsIntRegion &amp;,mozilla::layers::Layer::SurfaceMode) (in xul.dll)
mozilla::layers::ThebesLayerD3D10::Validate(mozilla::layers::ReadbackProcessor *) (in xul.dll)
mozilla::layers::ContainerLayerD3D10::Validate() (in xul.dll)
mozilla::layers::ContainerLayerD3D10::Validate() (in xul.dll)
mozilla::layers::LayerManagerD3D10::Render() (in xul.dll)
mozilla::layers::LayerManagerD3D10::EndTransaction(void (*)(mozilla::layers::ThebesLayer *,gfxContext *,nsIntRegion const &amp;,nsIntRegion const &amp;,void *),void *,mozilla::layers::LayerManager::EndTransactionFlags) (in xul.dll)
nsDisplayList::PaintForFrame(nsDisplayListBuilder *,nsRenderingContext *,nsIFrame *,unsigned int) (in xul.dll)
nsLayoutUtils::PaintFrame(nsRenderingContext *,nsIFrame *,nsRegion const &amp;,unsigned int,unsigned int) (in xul.dll)
PresShell::Paint(nsIView *,nsIWidget *,nsRegion const &amp;,nsIntRegion const &amp;,bool) (in xul.dll)
nsViewManager::Refresh(nsView *,nsIWidget *,nsIntRegion const &amp;,bool) (in xul.dll)
nsViewManager::DispatchEvent(nsGUIEvent *,nsIView *,nsEventStatus *) (in xul.dll)
...</pre>
<p>It&#8217;s also possible that a developer had a debugger attached and that these pauses are from code hitting breakpoints. Telemetry submissions should add a flag to indicate whether a debugger is attached (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=763138">bug  763138</a>).</p>
<h4>Other Hangs</h4>
<p>There were half a dozen other hangs in this data set that I still need to investigate further as their causes are somewhat perplexing and I am not familiar with the code in question. For example, in one hang stack, the CreateToolhelp32Snapshot API call used for gathering a list of libraries took 19 seconds while waiting to enter a critical section. In another, it looked like JavaScript ran for 63 seconds without being interrupted by the slow-script dialog box.</p>
<p>If anyone is interested in diagnosing these hangs, I&#8217;d appreciate it if you could take a look at the stacks and point me in the right direction or file bugs if you recognize a potential cause. You can leave me a comment on this post below.</p>
<p>These are the remaining stacks: <a href="http://people.mozilla.com/~vdjeric/other_hang_stacks.txt">http://people.mozilla.com/~vdjeric/other_hang_stacks.txt</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2012/06/08/cache-plugin-font-operations-most-common-in-chrome-hang-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Profiling with the Built-in Gecko Profiler and Local Symbols on Windows</title>
		<link>http://blog.mozilla.org/vdjeric/2012/05/30/profiling-with-the-built-in-gecko-profiler-and-local-symbols-on-windows/</link>
		<comments>http://blog.mozilla.org/vdjeric/2012/05/30/profiling-with-the-built-in-gecko-profiler-and-local-symbols-on-windows/#comments</comments>
		<pubDate>Thu, 31 May 2012 00:38:33 +0000</pubDate>
		<dc:creator>Vladan Djeric</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.org/vdjeric/?p=71</guid>
		<description><![CDATA[If you would like to use the built-in Gecko Profiler with a local build of Firefox for Windows, you will need to point the profiler to a local Snappy Symbolication Server instead of the official Mozilla symbolication server. The server &#8230; <a href="http://blog.mozilla.org/vdjeric/2012/05/30/profiling-with-the-built-in-gecko-profiler-and-local-symbols-on-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you would like to use the <a href="https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler">built-in Gecko Profiler</a> with a local build of Firefox for Windows, you will need to point the profiler to a local <a href="https://github.com/vdjeric/Snappy-Symbolication-Server/">Snappy Symbolication Server</a> instead of the official Mozilla symbolication server. The server will host the local Firefox symbols for the profiler and it will fetch any symbols not available locally from the official Mozilla symbolication server (e.g. symbols for Windows DLLs and plugin DLLs).</p>
<p>Instructions: <a href="https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler_and_Local_Symbols_on_Windows">https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler_and_Local_Symbols_on_Windows</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.org/vdjeric/2012/05/30/profiling-with-the-built-in-gecko-profiler-and-local-symbols-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
