<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Void pointers and miscellany.</description><title>Brrian to go.</title><generator>Tumblr (3.0; @brrian)</generator><link>http://brrian.tumblr.com/</link><item><title>And now something lighter... brson's grandmother!</title><description>&lt;p&gt;[11:13am] tjc: rustbot: build snap-stage3 qkzw&lt;br/&gt;[11:14am] auREAX: qkzw?&lt;br/&gt;[11:15am] tjc: auREAX: the FreeBSD bot&lt;br/&gt;[11:15am] tjc: only brson knows why it&amp;#8217;s called that &lt;br/&gt;[11:15am] auREAX: ah&lt;br/&gt;[11:15am] auREAX:&lt;br/&gt;[11:16am] brson: qkzw was my grandmother&amp;#8217;s name&lt;br/&gt;[11:16am] tjc: oh, that&amp;#8217;s touching&lt;br/&gt;[11:17am] graydon: she was a ham radio operator?&lt;br/&gt;[11:17am] brson: one of the best&lt;br/&gt;[11:17am] graydon: (or maybe fighter pilot? hm. call signs&amp;#8230;)&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/32882297090</link><guid>http://brrian.tumblr.com/post/32882297090</guid><pubDate>Thu, 04 Oct 2012 11:25:56 -0700</pubDate><category>rust</category><category>humor</category><category>irc</category><category>mozilla</category></item><item><title>Mobile Firefox: Measuring how a browser feels</title><description>&lt;a href="http://wrla.ch/blog/2012/06/mobile-firefox-measuring-how-a-browser-feels/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mobile-firefox-measuring-how-a-browser-feels"&gt;Mobile Firefox: Measuring how a browser feels&lt;/a&gt;: &lt;p&gt;Yes yes yes. Benchmarking Timelapse is something I’ve resisted doing, because there’s no convincing metrics to be derived using standard benchmarks. Since the user ultimately cares about FPS, this type of solution seems promising.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/26101089432</link><guid>http://brrian.tumblr.com/post/26101089432</guid><pubDate>Thu, 28 Jun 2012 15:55:47 -0700</pubDate><category>profiling</category><category>devtools</category><category>mozilla</category><category>testing</category><category>benchmarks</category></item><item><title>Cheat sheet for fuzzing/test generation with Firefox</title><description>&lt;a href="https://blog.mozilla.org/security/2012/06/20/7-tips-for-fuzzing-firefox-more-effectively/"&gt;Cheat sheet for fuzzing/test generation with Firefox&lt;/a&gt;: &lt;p&gt;This might be useful if someone wants to do fuzzing for security purposes, or perhaps for automatic test generation on the web.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/25676385887</link><guid>http://brrian.tumblr.com/post/25676385887</guid><pubDate>Fri, 22 Jun 2012 15:59:36 -0700</pubDate><category>fuzzing</category><category>testing</category><category>firefox</category><category>mozilla</category><category>cheat sheet</category></item><item><title>David Humphrey's end of semester Seneca/Mozilla reflections</title><description>&lt;a href="http://vocamus.net/dave/?p=1478"&gt;David Humphrey's end of semester Seneca/Mozilla reflections&lt;/a&gt;: &lt;p&gt;Dave’s efforts to expose undergraduate computer science students to the realities of Firefox development are inspiring and unparalleled in Higher Ed. I highly recommend those interested in CS Ed to familiarize themselves with his past teaching work at Seneca, and the extremely positive outcomes for his students.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/21875626985</link><guid>http://brrian.tumblr.com/post/21875626985</guid><pubDate>Thu, 26 Apr 2012 16:00:59 -0700</pubDate><category>mozilla</category><category>education</category><category>blog</category></item><item><title>Live Scratchpad addon for Firefox</title><description>&lt;a href="http://neonux.github.com/LiveScratchpad/"&gt;Live Scratchpad addon for Firefox&lt;/a&gt;: &lt;p&gt;Similar to the previously-posted PoC Light Table, but less ambitious and actually available. Also has a lot of headroom wrt. visualizing code coverage, data flow, …&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/21118013960</link><guid>http://brrian.tumblr.com/post/21118013960</guid><pubDate>Sat, 14 Apr 2012 18:19:27 -0700</pubDate><category>devtools</category><category>firefox</category><category>mozilla</category><category>debugging</category></item><item><title>Steve Yegge's recent rant about Google "not getting platforms"</title><description>&lt;a href="https://plus.google.com/112678702228711889851/posts/eVeouesvaVX"&gt;Steve Yegge's recent rant about Google "not getting platforms"&lt;/a&gt;: &lt;p&gt;Click this link. It’s one of the best overviews of architecture/strategy differences between Google, Amazon, Facebook, and Microsoft. I also think it is a good approximation to the differences between Firefox and Webkit as platforms.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/11484004374</link><guid>http://brrian.tumblr.com/post/11484004374</guid><pubDate>Sat, 15 Oct 2011 10:24:28 -0700</pubDate><category>research</category><category>mozilla</category></item><item><title>Slides for jsprobes brownbag at Mozilla</title><description>&lt;p&gt;I gave a brownbag internship talk on &lt;a href="http://air.mozilla.org"&gt;http://air.mozilla.org&lt;/a&gt; yesterday. I don&amp;#8217;t have access to a recording of the talk yet, but I&amp;#8217;m going to go ahead and post the (slightly revised) slides that I used. Let me know if anything is unclear. I&amp;#8217;ll post a link to a recording once it&amp;#8217;s available.&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;jsprobes brownbag slides (&lt;a href="http://www.cs.washington.edu/homes/burg/slides/jsprobes-slides.pdf"&gt;pdf&lt;/a&gt;,  &lt;a href="http://www.cs.washington.edu/homes/burg/slides/jsprobes-slides.pptx"&gt;pptx&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;</description><link>http://brrian.tumblr.com/post/10577367609</link><guid>http://brrian.tumblr.com/post/10577367609</guid><pubDate>Fri, 23 Sep 2011 17:57:31 -0700</pubDate><category>mozilla</category><category>research</category><category>slides</category></item><item><title>jsprobes: cross-platform browser instrumentation using JavaScript</title><description>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Browser instrumentation is the technical basis for performance tuning and many web-related research projects. Such projects boil down to recording interesting data as the browser runs, and optionally modifying the behavior of the browser itself based on recorded data. In an extensible browser such as &lt;a href="http://www.mozilla.org"&gt;Firefox&lt;/a&gt;, there are a number of means to accomplish these ends, each with certain tradeoffs:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/"&gt;Extensions/addons&lt;/a&gt; are code written in high-level &lt;a href="https://developer.mozilla.org/en/JavaScript"&gt;JavaScript&lt;/a&gt; and dynamically loaded at runtime. Extensions can record and modify the behavior of the browser to the extent allowed by the APIs of browser components (in Firefox, &lt;a href="https://developer.mozilla.org/en/XPCOM"&gt;XPCOM&lt;/a&gt; components).&lt;/p&gt;
&lt;p&gt;Extensions are eminently portable, cross-platform and relatively easy to author, &lt;strong&gt;but are limited in the data and behavior to which they have access&lt;/strong&gt;. Many low-level subsystems (such as the layout engine and JavaScript engine) are off-limits due to the performance and complexity costs of exposing certain functionality and data to a COM-like API. Furthermore, even if there are no performance considerations, many potentially interesting pieces of data remain unexposed for lack of (widespread) need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Many platform/OS-level dynamic instrumentation frameworks (such as &lt;a href="http://en.wikipedia.org/wiki/DTrace"&gt;DTrace&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/SystemTap"&gt;SystemTap&lt;/a&gt;, and Windows &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163437.aspx"&gt;ETW&lt;/a&gt;) allow for custom instrumentation in both kernel and user code. A common metaphor for these systems is the insertion of &amp;#8220;probes&amp;#8221; into the code, which perform some user-defined action.&lt;/p&gt;
&lt;p&gt;The main advantages of these probe frameworks is that they are incredibly low-overhead, and probes can be added and removed dynamically without recompiling or restarting. As a building block for browser research and tools, they are inadequate: &lt;em&gt;probes are difficult to write correctly, are not cross-platform, and the obtained data does not easily feed back into the program being inspected.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modifying the C++ source code of the browser is the brute-force method used by many performance analysts and researchers. The developer creates a fork of the browser source tree, makes local modifications, and optionally distributes a modified binary or source tarball to others who want to run the instrumented browser.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Hacking&amp;#8221; the browser in this way provides the ultimate power to record and change any behavior, but has significant drawbacks. &lt;em&gt;The researcher/developer must invest much time and energy to navigate and understand a large, foreign codebase&lt;/em&gt; just to figure out where to add instrumentation. Many independent developers do not have the resources to test their changes on all relevant platforms. Most importantly, &lt;em&gt;these modifications almost always doom the forked codebase (and thus the research project) to become a transitory software artifact instead of a useful tool.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;&lt;code&gt;jsprobes&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;jsprobes&lt;/code&gt; is cross-platform, portable, and flexible browser instrumentation framework. It follows the event-driven idiom common to DTrace and many browser components: certain locations in the code (&amp;#8220;probe points&amp;#8221;), when executed, can run custom bits of instrumentation. A significant feature of &lt;code&gt;jsprobes&lt;/code&gt; is that this instrumentation (&amp;#8220;probe handlers&amp;#8221;) is written in JavaScript. Browser data structures are exposed to instrumentation through a safe, easy-to-use data API.&lt;/p&gt;
&lt;p&gt;The framework was created to address the weak points of existing approaches and build on their strengths. More specifically, the design goals include:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cross-platform&lt;/strong&gt;: &lt;code&gt;jsprobes&lt;/code&gt; is implemented as part of the browser platform, instead of beneath it. There are no dependencies on specific operating system features, architectures, kernel modules, or escalated privileges (root access/jailbeaks).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;flexible&lt;/strong&gt;: Probe handlers have access to the full JavaScript language, and can leverage existing libraries. Adding new probe points or exposing additional data to instrumentation code is simple and customizable.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The handler execution model could be extended to serialize the probe event stream and data to disk, allowing for offline or remote evaluation of handlers.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;easy-to-use&lt;/strong&gt;: handlers are written in JavaScript, and handler-writers need not know the inner workings of Firefox data structures and architecture. Simple probes can be written using higher-level data API&amp;#8217;s, while complex probes can use lower-level data API&amp;#8217;s that more closely mirror the C++ view of browser data structures.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;portable&lt;/strong&gt;: Extensions are the de-facto way to share browser customizations; extensions can add, remove, and communicate with &lt;code&gt;jsprobes&lt;/code&gt;-based probe handlers using a standard XPCOM interface.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;cross-language&lt;/strong&gt;: Firefox is implemented using a mix of C++ and JavaScript. &lt;code&gt;jsprobes&lt;/code&gt; supports custom conversions between the data representations of C++ and JavaScript (or even JS-JS).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;low overhead&lt;/strong&gt;: The architecture of &lt;code&gt;jsprobes&lt;/code&gt; minimizes time spent by the main thread to execute probe handler code. Most handlers are executed asynchronously on a side thread, and communication happens via asynchronous message passing.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Although not yet implemented, the design is also conducive to future adoption of &amp;#8220;zero probe effect&amp;#8221; techniques used by other instrumentation frameworks like &lt;a href="http://en.wikipedia.org/wiki/DTrace"&gt;DTrace&lt;/a&gt;. These techniques are a prerequisite for &lt;code&gt;jsprobes&lt;/code&gt; to land in Firefox trunk.&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Current status&lt;/h3&gt;
&lt;p&gt;In it&amp;#8217;s current incarnation, &lt;code&gt;jsprobes&lt;/code&gt; is exposed via the &lt;code&gt;nsIProbeService&lt;/code&gt; XPCOM interface, which provides a high-level API to control the core instrumentation engine implemented inside SpiderMonkey. Accompanying this service and the core instrumentation engine are dozens of stub calls throughout the Firefox code base. These source locations are well-known and are shared by other instrumentation frameworks such as &lt;a href="http://en.wikipedia.org/wiki/DTrace"&gt;DTrace&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163437.aspx"&gt;ETW&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Currently &lt;code&gt;jsprobes&lt;/code&gt; is distributed as a patch series, and is &lt;a href="https://bitbucket.org/burg/jsprobes-patches"&gt;available on my bitbucket account&lt;/a&gt;. The patches track &lt;a href="https://tbpl.mozilla.org/?tree=Mozilla-Inbound"&gt;mozilla-inbound&lt;/a&gt; fairly closely as of the time of this writing. See the bitbucket page for more specifics.&lt;/p&gt;
&lt;h2&gt;Example: understanding GC behavior&lt;/h2&gt;
&lt;p&gt;Suppose you would like to know which benchmarks cause garbage collection (GC), the duration of such collections, and how much garbage is collected. At a data level, one needs to know the start and end times of each GC cycle, and the heap size before and after each GC.&lt;/p&gt;
&lt;h3&gt;Registering your instrumentation&lt;/h3&gt;
&lt;p&gt;Instrumentation is added and removed via an event handler-like interface, which should be familiar to DOM/JavaScript programmers. Each place where instrumentation could be added (i.e., at GC start and end) is called a &lt;em&gt;probe point&lt;/em&gt;. Each probe point has a fixed set of arguments: for example, the current JavaScript context, the current runtime, or the GC compartment to be collected.&lt;/p&gt;
&lt;p&gt;The instrumentation that should be executed upon reaching a probe point is called a &lt;em&gt;probe handler&lt;/em&gt; (to distinguish it from &lt;em&gt;event&lt;/em&gt; handlers). Probe handlers have access to the probe point arguments, but the actual handler code is run asynchronously on a separate thread with its own JavaScript heap.  So, the probe point arguments are serialized when the probe point is reached, and then later deserialized into the handler-heap when the handler runs.&lt;/p&gt;
&lt;p&gt;In our example, the probe points of interest are &lt;code&gt;GC_DID_START&lt;/code&gt; and &lt;code&gt;GC_WILL_END&lt;/code&gt;. These probe points are constants defined in the &lt;code&gt;nsIProbeService&lt;/code&gt; interface, and each are described in the (forthcoming) documentation. Their interfaces are:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GC_DID_START(runtime)
GC_WILL_END(runtime)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each argument type has a specific API as well. Below, to the left of the arrow is the field name, and to the right of the arrow is the data type. Capitalized types are representable by instances of the equivalent JavaScript prototypes. (&lt;code&gt;env&lt;/code&gt; is a special implicit argument to all probe points, and is always available.)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;runtime:
    heapSize       -&amp;gt; Number
gcTriggerBytes -&amp;gt; Number
heapLastSize   -&amp;gt; Number
heapMaxSize    -&amp;gt; Number

env:
    currentTimeMS  -&amp;gt; Date
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At each of these points, we want to record heap size and current time. Fortunately, this data is readily available from the probe point arguments above. So, our two handlers should look like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/* handler for GC_DID_START */
/* format: [startTime, stopTime, startHeap, stopHeap] */
record = [env.currentTimeMS, 0, runtime.heapSize, 0];

/* handler for GC_WILL_END */
record[1] = env.currentTimeMS;
record[3] = runtime.HeapSize;
pendingData.push(record);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is one more piece required before we can register these probe handlers: a &lt;em&gt;data specification&lt;/em&gt;. Probe handlers run asynchronously, but data must be captured and serialized on the main thread when the probe point is reached. Capturing all of the data is expensive&amp;#8212;-Data specifications tell the instrumentation engine exactly which values need to be captured.&lt;/p&gt;
&lt;p&gt;Data specifications are easy to write. Both of the above probe handlers have the same data specification:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;using(env.currentTimeMS);
using(runtime.heapSize);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To put all of this together, we would make the following calls to &lt;code&gt;nsIProbeService&lt;/code&gt; from an addon:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const Ci = Components.interfaces;
const Cc = Components.classes;
const probes = Cc['@mozilla.org/base/probes;1']
                 .getService(Ci.nsIProbeService);

var activeHandlers = [];
var cookie;

cookie = probes.addHandler(probes.GC_DID_START,
               "using(env.currentTimeMS);" +
               "using(runtime.heapSize);",
               "record = [env.currentTimeMS, 0, runtime.heapSize, 0];");
activeHandlers.push(cookie);

cookie = probes.addHandler(probes.GC_WILL_END,
               "using(env.currentTimeMS);" +
               "using(runtime.heapSize);",
               "record[1] = env.currentTimeMS;" +
               "record[3] = runtime.heapSize;" +
               "pendingData.push(record);");
activeHandlers.push(cookie);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that &lt;code&gt;probes.addHandler&lt;/code&gt; returns a cookie, which is usable later as an argument to the corresponding &lt;code&gt;probes.removeHandler&lt;/code&gt; API method.&lt;/p&gt;
&lt;p&gt;Now that we&amp;#8217;ve registered some probe handlers, subsequent garbage collections will trigger our instrumentation. This is great, but we eventually want to know the results of our instrumentation. &lt;code&gt;nsIProbeService&lt;/code&gt; has one more method called &lt;code&gt;asyncQuery&lt;/code&gt;. The arguments to &lt;code&gt;asyncQuery&lt;/code&gt; are 1) some JavaScript source to run, and 2) an optional callback to invoke whenever a message is sent using &lt;code&gt;postMessage&lt;/code&gt; from the handler thread to the probe service (main thread). For our example, we need two calls to &lt;code&gt;asyncQuery&lt;/code&gt;: one for setup, and a periodic script that collects pending data records:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/* setup: run this before registering handlers */
probes.asyncQuery("pendingData = [];", function(){});

/* collection: run this periodically to marshal results */
probes.asyncQuery("while (pendingData.length) {        " + 
                  "    postMessage(pendingData.pop()); " +
                  "}                                   ",
                  function(msg) { results.push(msg); });
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once data starts rolling in via the callback, we can take action on the &lt;code&gt;results&lt;/code&gt; array of records. For example, we could graph the data to show heap size over time, or plot GC pause length vs. garbage claimed. In fact, I have developed a demo extension called about:gc which does exactly this. It is available at my &lt;a href="https://bitbucket.org/burg/aboutgc"&gt;bitbucket.org/burg/aboutgc&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For now, you can &lt;a href="http://www.cs.washington.edu/homes/burg/resources/aboutgc-screenshot.png"&gt;view a screenshot of the about:gc prototype&lt;/a&gt; while running the &lt;a href="http://www.dromaeo.com"&gt;Dromaeo&lt;/a&gt; benchmark suite.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/10571624125</link><guid>http://brrian.tumblr.com/post/10571624125</guid><pubDate>Fri, 23 Sep 2011 15:36:00 -0700</pubDate><category>mozilla</category><category>research</category><category>jsprobes</category><category>tools</category></item><item><title>Ixnay on the Avro</title><description>&lt;p&gt;Perhaps I should have read the &lt;a href="http://avro.apache.org/"&gt;Avro&lt;/a&gt; documentation a little more closely. It requires &lt;a href="http://www.boost.org/"&gt;Boost&lt;/a&gt; headers, the Boost regular expression library, as well as &lt;code&gt;flex&lt;/code&gt; and &lt;code&gt;bison&lt;/code&gt; in order to &lt;em&gt;compile&lt;/em&gt;. If I don&amp;#8217;t want my code to have a chance of making it upstream, adding these big libraries is a good start. Meanwhile, it seems &lt;code&gt;upb&lt;/code&gt; is still too premature. In the meantime, I will just pass bulky, inefficient C++ data structures around :(&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/8650838783</link><guid>http://brrian.tumblr.com/post/8650838783</guid><pubDate>Mon, 08 Aug 2011 10:48:24 -0700</pubDate><category>research</category><category>mozilla</category></item><item><title>Optserver update and some new collabopts</title><description>&lt;p&gt;Since the last &lt;a href="http://brrian.tumblr.com/post/8094992114/collaborative-optimization-in-progress"&gt;collabopt&lt;/a&gt; update, I&amp;#8217;ve put some more work into the server software (dubbed &lt;code&gt;optserver&lt;/code&gt;) that collects and aggregates profiles. This server is implemented in &lt;a href="http://www.nodejs.org"&gt;NodeJS&lt;/a&gt; and &lt;a href="https://github.com/developmentseed/node-sqlite3/wiki/API"&gt;sqlite3&lt;/a&gt;. I have a support request in for a test phone that can run Fennec (aka Mobile Firefox). Once this comes, I will collect some profiles and see what the potential speedups are for the image load order optimization. (There may also be some tuning necessary to make the profile recording-extension work with mobile.)&lt;/p&gt;
&lt;p&gt;Recently I have also thought of some other potential optimizations that should not be too hard to &lt;em&gt;aggregate&lt;/em&gt; or &lt;em&gt;optimize&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;strong&gt;GC frequency/allocation rate&lt;/strong&gt;: if we can observe that a particular website is animation-intensive or allocates a lot of short-lived objects, then we could pre-emptively run the GC more often than normal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compartment heap size&lt;/strong&gt;: If we notice that particular websites keep a lot of objects alive, then fruitless GC time can be reduced by making the heap larger than normal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default image size&lt;/strong&gt;: When loading webpages, often the size of image elements is unknown until the resource has been downloaded and decoded. In absence of size hints (such as the &lt;code&gt;width="80"&lt;/code&gt; HTML attribute or &lt;code&gt;min-width: 80px&lt;/code&gt; CSS property), the rendering engine must &lt;em&gt;guess&lt;/em&gt; a default size for the image element. If this guess was inaccurate (known after downloading the image), the guessed image size may negatively effect on any following page content. If the guess was too big, page content may be pushed further down than necessary, and cause a &lt;a href="http://www.phpied.com/rendering-repaint-reflowrelayout-restyle/"&gt;layout reflow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To avoid costly reflow, we can observe actual image dimensions during multiple loads of a website, and give this size information to new site visitors.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;All three of these optimizations are conceptually simple, but &lt;em&gt;recording&lt;/em&gt; profiles with this data is difficult or impossible if one can only use the internal JavaScript APIs of the browser. The values we seek to record are deep in the guts of the JavaScript engine (1 and 2) and layout engine (3). &lt;strong&gt;We require a different approach to recording this data in a low-overhead way.&lt;/strong&gt; This different recording approach is the next major technical challenge of my internship. I have been brainstorming most of this week on approaches, and will write another post once the design has settled more.&lt;/p&gt;</description><link>http://brrian.tumblr.com/post/8568496419</link><guid>http://brrian.tumblr.com/post/8568496419</guid><pubDate>Sat, 06 Aug 2011 13:07:53 -0700</pubDate><category>collabopt</category><category>research</category><category>mozilla</category></item></channel></rss>
