Tag Archives: speed

Things I’ve Learned This Week (May 18 – May 22, 2015)

You might have noticed that I had no “Things I’ve Learned This Week” post last week. Sorry about that – by the end of the week, I looked at my Evernote of “lessons from the week”, and it was empty. I’m certain I’d learned stuff, but I just failed to write it down. So I guess the lesson I learned last week was, always write down what you learn.

How to make your mozilla-central Mercurial clone work faster

I like Mercurial. I also like Git, but recently, I’ve gotten pretty used to Mercurial.

One complaint I hear over and over (and I’m guilty of it myself sometimes), is that “Mercurial is slow”. I’ve even experienced that slowness during some of my Joy of Coding episodes.

This past week, I was helping my awesome new intern get set up to tear into some e10s bugs, and at some point we went through this document to get her .hgrc all set up.

This document did not exist when I first started working with Mercurial – back then, I was using mq or sometimes pbranch, and grumbling about how I missed Git.

But there is some gold in this document.

gps has been doing some killer work documenting best practices with Mercurial, and this document is one of the results of his labour.

The part that’s really made the difference for me is the hgwatchman bit.

watchman is a tool that some folks at Facebook wrote to monitor changes in a folder. hgwatchman is an extension for Mercurial that takes advantage of watchman for a repository, smartly precomputing a bunch of stuff when the folder changes so that when you fire a command, like

hg status

It takes a fraction of the time it’d take without hgwatchman. A fraction.

Here’s how I set hgwatchman up on my MacBook (though you should probably go by the Mercurial for Mozillians doc as the official reference):

  1. Install watchman with brew:
    brew install watchman
  2. Clone the hgwatchman extension to some folder that you can easily remember and build it:
    hg clone https://bitbucket.org/facebook/hgwatchman
    cd hgwatchman
    make local
  3. Add the following lines to my user .hgrc:
    [extensions]
    hgwatchman = cloned-in-dir/hgwatchman/hgwatchman
  4. Make sure the extension is properly installed by running:
    hg help extensions
  5. hgwatchman should be listed under “enabled extensions”. If it didn’t work, keep in mind that you want to target the hgwatchman directory
  6. And then in my mozilla-central .hg/.hgrc:
    [watchman]
    mode = on
  7. Boom, you’re done!

Congratulations, hg should feel snappier now!

Next step is to try out this chg thingthough I’m having some issues still.

Gecko Profiler now works in Thunderbird Daily

One of the first steps to making software snappier is knowing where the bottlenecks are. For Thunderbird, finding those bottlenecks has been hard – we haven’t had any tools to make drilling down to the slow bits easy.

Until now.

The platform folks have developed a really awesome profiler tool, and it’s been working really nicely in Firefox for some time now.

This past week, I spent a few hours making it work in Thunderbird.

If you’ve got a recent Daily of Thunderbird around, you can try it out right now.

How to bask in the glory of this awesome tool

  1. Make sure your Daily is recent. Anything built from today onwards should work.
  2. Install this add-on. It’s restartless!
  3. Check out your status bar. There should be two little panels there – “Disabled”, and “Dump Profile”
  4. Click on “Disabled” to switch the profiler into “Enabled” mode. Once you do that, it starts recording.
  5. Do some stuff, like check your mail…or do a search.
  6. Click on “Dump Profile”.
  7. A content tab will open that will show you profiling data gathered up to that point.
  8. Click on “Enabled” to disable the profiler – this will clear out the recording, to let you do a new one.

The web app that lets you browse the profile data is pretty sophisticated – you can read the skinny about it here.

Cooking with gas

On Windows or OSX, do an optimized, non-debug build of comm-central with the –enable-profiling flag set. Now you get super rich profiling data. Now you’re cookin’ with gas.

So hopefully this will be useful in making Thunderbird better, faster and stronger.

Big thanks to Benoit Gerard for his help and guidance porting the add-on, and the platform team for creating such a badass tool.