Jetpacking: The 0.3 SDK and a peek at what’s coming next.

I’ve been working on the Jetpack project for about a month now – implementing features, fixing bugs, and generally helping move things forward as we build out the wide set of capabilities needed to enable an *awesome* future for Firefox add-on development.

The Jetpack team released the 0.3 version of the SDK yesterday, which has a bunch of platform improvements, and also the context menu API – the first UI feature to ship in the SDK. The SDK documentation has an example of using this feature that shows 1) how easy it is to build UI features with Jetpack, but also 2) shows how add-on development process has *changed* with the SDK. For example, all of the manual packaging steps are *gone*. That’s right. No more crazy directory structures, no more RDF files, no more GUIDs. All of that stuff is gone, replaced with a couple of simple commands. It’s not perfect yet, but expect it to get even easier to both package and deploy add-ons as we build out the SDK further.

So what’s next? The 0.4 release is where the feature set of the SDK really starts to blow up:

  • Panels: Floating rich content, tooltips, contextual UI.
  • Private Browsing: Making it easy for add-ons to respect your privacy.
  • Selection: Remember how awesome it was having an intuitive selection API in Ubiquity?
  • Localization: Simple access and distribution of locale data.
  • Page Worker: Like a Web Worker, but with more privileges and a DOM.
  • Simple Storage: Persistent object store – like DOMStorage for add-ons.
  • Places: Improved bookmarks and history searching and browsing.
  • Widgets: A preview of the ideas Daniel and Boriss have recently blogged about.
  • Request: Even easier AJAX (Please don’t make that into an acronym. Please.)
  • Installable without needing to restart Firefox (trunk builds only).
  • Documentation: More and better!

And it’s not just about the feature set: The diligent focus of the Jetpack core team on developer ergonomics, and the experience gained from the Jetpack prototype and projects like Ubiquity, is resulting in a set of APIs that are far more intuitive and easy to use than the current XPCOM-riddled minefield that add-on developers have to deal with today.

If you have questions or suggestions, let me know in the comments, or join us on Jetpack developer forum.


Firefox Performance Update

I’ve been focusing more on Jetpack development this quarter, but will still be posting performance round-ups regularly here. In fact, here’s one now:

  • Taras Glek continues to blog his progress on improving the binaries we ship, talking about how reordering binaries improves memory use as well as load time, leveraging GCC’s PGO for fast startup, and finally about Icegrind, his Valgrind plugin that generates a log of the order of access to mmap’d files.
  • Are we fast yet?! The answer to that question, at least in regards to JavaScript performance test suites, can be found at AreWeFastYet.com, where you’ll see graphs that show Firefox trunk’s performance relative to Google’s V8 and Apple’s Nitro on the Sunspider and V8Bench tests. I won’t spoil the answer for you, you’ll have to go check it out for yourself.
  • I finished and checked-in my changes to the Tinderbox Pushlog, adding a new feature that provides at-a-glance comparison in performance test results between any two pushes on the page (screenshot). It will go live next time Marcus pushes changes out to his server. But he’s not online at the moment, so I don’t know when this feature will go live. Heh, it went live moments after I published this post.
  • Heather Arthur and Clint Talbert are working on a project to add performance data to Addons.mozilla.org for extensions. They’re starting with the effect of a given extension on Firefox startup time. Follow along on the bug, or watch project Dirty Harry on Github.
  • Improving the AMO extension validator: AMO scans uploaded extensions and reports problems to the authors. For performance best-practices, we should at least warn the authors if possible if their add-on is doing something that’ll make Firefox slow. This bug is for warning about add-ons that don’t have their content in a JAR file. If you see any thing in the best practices guide that can be statically detected, please file a bug for it here.

If you have any other performance-related bugs, blog posts, anecdotes or other tomfoolery, post it in the comments!


Firefox Performance Update

As I mentioned in my previous update, the scope of these updates has expanded beyond start-up time. That said, I can’t keep track of everything! So if you have an update, email it to me if you want it in the post, or just add it in the comments.

  • First, I just have to say that Marco’s fix for bug 542943 has changed the way I think about browser restarts, removing the fear entirely. It turns out that, for me anyway, the majority of the slowness involved in restarting was waiting for the process to exit. After Marco’s landing, it’s nearly instantaneous.
  • While I was away, Taras blogged nearly daily about his findings while working on Linux code locality. He first posted a graph of I/O from library loading, then a long post about why library loading sucks on Linux, followed by some findings regarding madvise and prelink, finally posting about linker inefficiencies and SuSE’s workaround.
  • Mike Wu and others are moving forward on the “omnijar” project, which moves most of the core application files into a single JAR file. Taras described it as “extreme filesystem makeover”, and found ~10% start-up improvement with this approach on the desktop.
  • Clint Talbert and Heather Arthur are beginning work on a project that measures add-on performance, that will hook into AMO to show developers how their add-ons perform.
  • Drew Willcoxon got r+ on bug 536893 to allow asynchronous opening of Places query results. Once we start using the feature, expect bookmark and history UI to get snappier!
  • Taras got review on bug 516085, which consolidates access to core services that currently accessed hundreds of thousands of times during a browsing session.
  • A bunch of people have added tips to the add-on performance “best practices” document. I’ll be cleaning it up and moving it to MDC soon.
  • While the tinderbox pushlog is fantastic for viewing per-checkin results, and a broader view of tree activity, it doesn’t provide any facility for comparing the results of performance tests between landings. So I spent some time this week writing an addition that allows you to select any two pushes, and view a comparison table showing the difference in performance across all tests on all operating systems for those revisions. I’ll clean it up, and try to get it deployed, but regardless will make it available as a Jetpack or Greasemonkey script sometime next week.

For more info:

  • Startup performance activity is tracked here.
  • Add-on performance efforts are being tracked on this page.
  • Weekly performance results for all measurements are available on the snapshot, and trends available on the dashboard.