SlideShare a Scribd company logo
@atlassian #atlascamp
Show Me the Numbers
Automated Browser Performance Testing

Chris Mountford
Senior Software Developer, JIRA
Atlassian
@chromosundrift
2
Chris Mountford

2005
3.4.1
185
16660
3
Chris Mountford

4
Chris Mountford

4
Chris Mountford
Inline Edit

4
Chris Mountford
Inline Edit

4
Chris Mountford
Inline Edit

Search

4
Chris Mountford
Inline Edit

Search

4
Chris Mountford
Inline Edit

Search
Detail View
4
Chris Mountford
Inline Edit

Search
Detail View
4
Browser Performance
Testing
Welcome!
Browser Performance Testing

“of specific interactions for a single user
Measuring the perceived performance

”
6
Browser Performance Testing

“of specific interactions for a single user
Measuring the perceived performance
perceived

”
7
Outline
• Intro

• Optimisation Techniques

• JavaScript Renaissance
Engineering

• Perception

• Performance Factors

• Gotchas
• Take Aways

• JIRA Perf Tests

8
Outline
• Intro

• Optimisation Techniques

• JavaScript Renaissance
Engineering

• Perception

• Performance Factors

• Gotchas
• Take Aways

• JIRA Perf Tests

8
JavaScript Timeline
A history
lesson
1995

Classical JavaScript

10
Browser Wars

10
Browser Wars

Dark Ages

10
Dark Ages

Firebug

10
V8

Firebug

10
V8

Node.js

Firebug

10
Node.js

Hipsters

10
11
12
13
“Why do we split everything
into so many files?”

13
“Why do we split everything
into so many files?”

“Performance.”
13
14
“Why do we merge all the files
into large batches?”

14
“Why do we merge all the files
into large batches?”

“Performance.”
14
15
“Why...”

15
“Why...”

“Performance!”
15
“Why...”

“Performance!”
15
“

Show me the numbers!

”

– Not Jacky Chan

Hey it’s
Jacky

16
“ If all we have are opinions, let’s go
with mine.
”
If we have data, let’s look at data.

Netscape
CEO

– Jim Barksdale

17
Factors That Influence
Browser Performance
sad panda
Mobile Web
• Everything is the same but worse
• network / radio power mode steps, sleep, etc.
• cpu / battery impact
• memory
• standards compliance
• tooling
19
Network
Time
20
Parse
Time
21
JavaScript Execution
• JS Engines
• native bind(), map() etc

• DOM Manipulation
• events

• JQuery
• Sizzle selectors
• micro-optimisation ☠

• Memory leaks

22
Blocking

23
Blocking
<script src=”wtf.js”>
23
Top Tools
Chrome DevTools
Firebug Lite
dynaTrace

24
Reflow
26
inspired by @stoyanstefanov

27
Will It Reflow?
inspired by @stoyanstefanov

27
Will It Reflow?
inspired by @stoyanstefanov

27
Yes!

Will It Reflow?
inspired by @stoyanstefanov

27
But wait, there’s more!
• CSS Transforms
• Hardware acceleration?

• Data weight
• Concurrent request count
• Inline Base64 Encoded resources

28
But wait, there’s more!
• CSS Transforms
• Hardware acceleration?

• Data weight
• Concurrent request count
• Inline Base64 Encoded resources

28
Designing the JIRA
Browser Performance
Test Suite
Sweet!
JIRA Browser Perf Tests

30
JIRA Browser Perf Tests

Page
Objects
30
JIRA Browser Perf Tests

Page
Objects

Soke
Framework
30
JIRA Browser Perf Tests

Page
Objects

Soke
Framework

Bamboo
30
JIRA Browser Perf Tests

Page
Objects

Soke
Framework

Plugin

Bamboo
30
JIRA Browser Perf Tests

Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests

Hacking
Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests
Koto
Charts
Hacking
Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests
Koto
Charts

Psycho
Events
Hacking

Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests
Koto
Charts

Psycho
Events

OnDemand
Analytics

Hacking
Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests
Baselines
Koto
Charts

Psycho
Events

OnDemand
Analytics

Hacking
Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
JIRA Browser Perf Tests
Baselines
Koto
Charts

Vigilance

Psycho
Events

OnDemand
Analytics

Hacking
Page
Objects

Soke
Framework

Plugin

DB

Bamboo
30
Soke Interactions
• Define Timed Sections
• Number of Repetitions
• Personas

31
Soke Interactions
• Define Timed Sections
• Number of Repetitions
• Personas

Big ups to
Atlassian
PerfEng
Team

31
Soke Interactions in Scala

32
33
33
34
Optimisation Techniques
• Batching
• Atlassian Plugins, No Worries
• Predictive Fetching
• Guided by Analytics
• Caching
• Watch for memory leaks
35
“

I don’t know... it just feels slow.

”

– a JIRA Product Manager

Show me the
numbers!

36
Perception is Reality
No, it only
seems that way
38
Psycho Latency
• Ready for Action
• When does the User believe the app is waiting for her?

• Manual “psycho” event placement
• and maintenance!

• Yardstick tuning against a real system
• Optimisation Example: Execution Reordering
39
Gotchas
I’m gonna
click( )
Selenium / Webdriver

42
Selenium / Webdriver
• Chromedriver implemented by Chromium team

42
Selenium / Webdriver
• Chromedriver implemented by Chromium team
• mouse click on geometric centre of target

42
Selenium / Webdriver
• Chromedriver implemented by Chromium team
• mouse click on geometric centre of target
• W3C Webdriver wire protocol draft

42
Selenium / Webdriver
• Chromedriver implemented by Chromium team
• mouse click on geometric centre of target
• W3C Webdriver wire protocol draft
• OK Browsers, follow the standard!

42
Selenium / Webdriver
• Chromedriver implemented by Chromium team
• mouse click on geometric centre of target
• W3C Webdriver wire protocol draft
• OK Browsers, follow the standard!

42
Selenium / Webdriver

43
Selenium / Webdriver
• Windows and IE process control

43
Selenium / Webdriver
• Windows and IE process control
• Browser auto-upgrades

43
Selenium / Webdriver
• Windows and IE process control
• Browser auto-upgrades
• Changing what you measure

43
Selenium / Webdriver
• Windows and IE process control
• Browser auto-upgrades
• Changing what you measure
• Prefetch cache benefit in JIRA 6.0

43
Take Aways
• Lots of factors
• Measure perceived reality
• Be holistic, quantitative, beware micro-optimisation trap
• Monitor and Maintain your performance suite
• Use Chrome DevTools etc.

44
Thank you!
For resources:
#atlascamp
@chromosundrift

More Related Content

AtlasCamp 2013: Show Me Number! Automated Browser Performance Testing