Three Monkeys, Three Typewriters, Two Days(RSS )

February 4, 2010

Understanding the numbers your profiler gives you

A common situation I run into is that I have some testcase, I profile it, then I optimize one of the things that looks slow a bit and reprofile. If I'm lucky, then the fraction of time it takes drops from B to A (A < B of course, with B standing for "before" and A for "after"). What does that mean for the overall time of the testcase?

Obviously, what it means depends on both A and B. If we assume that the time taken for the part that wasn't optimized hasn't changed, then the overall speedup is (1-A)/(1-B).

So B - A = 5% would mean a 2x speedup if B is 95% and A is 90%, and only a 1.05x speedup or so if B is 5% and A is 0%. If B is something like 53% and A something like 48%, then you get a 1.11x speedup.

All of which is to say that focusing on the hotspots is _really_ the way to go, if at all possible.

Posted by bzbarsky at 3:21 PM | Comments (4) | TrackBack (0)

January 29, 2010

Cross-compiling success

I took another stab at directly cross-compiling (not via distcc) using toolwhip. My previous attempt failed, but not due to libffi at all. The problem there was that I had the Mac ld in my path before the host ld. After fixing that and a few mozilla build system issues and making sure the build system can find the right SDK and the right ar and such I now have a cross-compile setup working. No make package yet, since that requires the dmg-creation utility which I don't have on the Linux machine. No --enable-breakpad support yet due to bug 543111. --enable-shark needs headers I don't have on that machine yet, so I'd need to sort that out. But for basic bisecting, this works.

Just so I can find it later, the working mozconfig file I'm using is something along these lines:

mk_add_options MOZ_MAKE_FLAGS="-s -j10"
export MOZ_MAKE_FLAGS="-s -j10"

mk_add_options CC="ccache /Developer/usr/bin/gcc-4.2"
export CC="ccache /Developer/usr/bin/gcc-4.2"

mk_add_options CXX="ccache /Developer/usr/bin/g++-4.2"
export CXX="ccache /Developer/usr/bin/g++-4.2"

mk_add_options CROSS_LIB_PATH="/Developer/usr/lib:/Developer/SDKs/MacOSX10.5.sdk/usr/lib"
export CROSS_LIB_PATH="/Developer/usr/lib:/Developer/SDKs/MacOSX10.5.sdk/usr/lib"

mk_add_options CROSS_COMPILE="1"
export CROSS_COMPILE="1"

export LD=/Developer/usr/bin/ld
export AR=/Developer/usr/bin/ar

mk_add_options PATH="/home/bzbarsky/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/Developer/usr/bin:/Developer/SDKs/MacOSX10.5.sdk/usr/bin"
export PATH="/home/bzbarsky/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/Developer/usr/bin:/Developer/SDKs/MacOSX10.5.sdk/usr/bin"

ac_add_options --target=i686-apple-darwin9
ac_add_options --enable-application=browser
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
ac_add_options --disable-crashreporter
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --disable-tests

Various other --enable-whatever are hanging out in there too, but the above are sort of the minimal set one needs at the moment.

Posted by bzbarsky at 5:25 PM | Comments (0) | TrackBack (0)

January 25, 2010

H.264 patents outside the US

I've seen a number of comments recently along the lines of "I'm in Europe, so the H.264 patents don't apply to me; why are you not letting me have a browser that plays my Youtube videos?" So I took a look at the list of patents on H.264. Or rather, the first 6 pages of the 43 page list. Excluding the US, there are relevant patents granted in at least the following countries:

I wasn't reading very carefully; I'd be suprised if I didn't miss a few, or if a few more don't come later in the list somewhere.

Posted by bzbarsky at 10:47 PM | Comments (12) | TrackBack (0)

January 20, 2010

From the mouths of babes

Today Arlan happened to look at my screen when part of the desktop was actually visible. That led to approximately the following conversation:

Arlan:
Папа, там лиса!
Me:
Где? Да, там лиса.
Arlan:
Еще лиса! Две лисы.
Me:
Две?
Arlan:
Один, два, три.... Три лисы!

Little did he know that the fourth one (3.5 to be exact) was hiding under the iTunes window....

Posted by bzbarsky at 12:19 AM | Comments (2) | TrackBack (0)