2015-07-26

Browsermark: Introduction

By more or less random selection, let's start our investigative journey with the browser benchmark creatively named Browsermark. Browsermark is a relatively new kid on the benchmarking block, having been released less than three years ago in November 2012; the current version 2.1 is from May 2014. The official description is at http://www.basemark.com/product-catalog/browsermark/, supposedly it’s a "hugely popular" benchmark designed to help you "choose the best browser for your PC or smartphone". Sounds good, let's see what it does.

Running the benchmark in the browser shows a series of fancy moving things, but extremely little technical detail about what's going on under the hood. After running the tests, a single performance score is displayed, with no information on how this score was computed (e.g. which individual tests scored how much). The official description (see link above) informs us that we need to pay for the "professional" version if we're interested in the breakdown. There is also no link to the source code of the benchmark -- so at this point, we may as well assume that a random number is chosen as the final score.

Fortunately for our inquiring minds, any benchmark program downloaded and executed by a browser can also be inspected by the user using that browser. In fact, this is even easier by using a command-line tool to retrieve the web site as plain text. So let’s take a look at the HTML source of the page:
$ curl web.basemark.com
This spits out a bunch of text, and at the very end, we find this little snippet:
<div id="next_test" data-next="http://web.basemark.com/tests/2.1"></div>
OK, so let’s look at that:
$ curl web.basemark.com/tests/2.1
lo and behold:
<div id="next_test" data-next="http://web.basemark.com/tests/2.1/benchmarks"></div>
$ curl web.basemark.com/tests/2.1/benchmarks
I'm beginning to see a pattern here:
<div id="next_test" data-next="http://web.basemark.com/tests/2.1/benchmarks/css"></div>
$ curl web.basemark.com/tests/2.1/benchmarks/css
<div id="next_test" data-next="http://web.basemark.com/tests/2.1/benchmarks/css/2d_transform"></div>
Finally, after this chain of redirections, we get to the first actual test's source:
$ curl web.basemark.com/tests/2.1/benchmarks/css/2d_transform
which, of course, contains the link to the next test at the end. Before that, we find this test's source. Looks like the meat of the logic for this test is in http://web.basemark.com/tests/2.1/benchmarks/css/2d_transform/test.js.

The benchmarking framework shared by all individual tests appears to be in http://web.basemark.com/tests/benchmark.js.gz. Unzipping and formatting makes this file human readable.

Now we have what we need to start looking in more detail.

One interesting observation is that the benchmark's description lists three tests in the "JavaScript" section. However, the actual benchmark performs a fourth test, namely "Array Blur". Excited like a little kid about having found this easter egg, let's pick that at the first benchmark to look at, shall we?

No comments:

Post a Comment