3.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Where does all the time go?
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

4.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Who controls it?
Some of this we control and some of it we don’t
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

5.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Back end
Measuring and improving back end performance can be done
during development
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

6.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
80-20
Turns out that less than 20% of the time is spent on the back
end
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

24.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
A/B testing
You also want to be able to dynamically tune which users get
which tests
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

25.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Phone home
It’s most useful if you can send these measurements back to
your server for analysis
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

26.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Mostly ubiquitous
We know that javascript is available on almost every browser
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

28.
Why measure? The slow web
boomerang Measurements
data data data Measuring with javascript
Limited
But javascript can’t measure everything... we get as close as
we can
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

29.
Why measure? What?
boomerang How does it work?
data data data Accuracy
A piece of javascript that you add to your web page where it
measures and beacons back to you, the end user’s perceived
performance of your page
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

31.
Why measure? What?
boomerang How does it work?
data data data Accuracy
What does it do?
About once a week, measures user’s bandwidth and
latency to your server
On (almost) every request, measures the time it took to
load the current page
Beacons these results back to your server
Other stuff based on plugins
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

32.
Why measure? What?
boomerang How does it work?
data data data Accuracy
How does it do it?
Let’s take that one at a time
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

33.
Why measure? What?
boomerang How does it work?
data data data Accuracy
How do we measure latency?
Download a 32 byte gif 10 times in sequence
Measure the time to download each
Discard the ﬁrst measurement because it’s overpriced
Calculate the arithmetic mean, standard deviation and
margin of error of the rest
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

35.
Why measure? What?
boomerang How does it work?
data data data Accuracy
How do we measure bandwidth?
After the latency test is done, we download progressively
larger images
Stop at the ﬁrst image that times out
Redownload that image a few more times
Calculate the median, standard deviation and margin of
error of the largest images
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

36.
Why measure? What?
boomerang How does it work?
data data data Accuracy
Measuring latency before bandwidth helps here
Those 10 latency images do a lot to widen the TCP
window size
The bandwidth images make much better use of bandwidth
The image we end with uses the most bandwidth
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

37.
Why measure? What?
boomerang How does it work?
data data data Accuracy
How do we measure page load time?
In the onbeforeunload event, measure the time and
store it in a cookie
In the onload event, check the cookie, and measure the
difference with the current time
We also make sure that the page that set the cookie is the
referrer of the current page
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

38.
Why measure? What?
boomerang How does it work?
data data data Accuracy
What? Two pages?
Yes, this needs two pages and cookies. If those aren’t
supported, we try to use the WebTiming API.
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang

39.
Why measure? What?
boomerang How does it work?
data data data Accuracy
How accurate is it?
Latency measurements are very accurate (±1%)
Bandwidth is to an order of magnitude. For bad
connections can be ±30%
Page load time sometimes has outliers, you need
post-ﬁltering
The margin of error tells you how good your data is
NY Performance Meetup / 2010-09-15 Measuring the web with boomerang