Client-side Performance Testing

31
CLIENT-SIDE PERFORMANCE TESTING Anand Bagmar Test Practice Lead

Transcript of Client-side Performance Testing

Page 1: Client-side Performance Testing

CLIENT-SIDE PERFORMANCE TESTING Anand Bagmar Test Practice Lead

Page 2: Client-side Performance Testing

@BagmarAnand about.me/anand.bagmar

ABOUT ME

Page 3: Client-side Performance Testing

WHAT DO YOU EXPECT FROM THIS SESSION?

Page 4: Client-side Performance Testing

What is

Performance Testing?

Page 5: Client-side Performance Testing

What is

Performance Engineering?

Page 6: Client-side Performance Testing

TYPICAL ARCHITECTURE

Page 7: Client-side Performance Testing

Lets draw!

Page 8: Client-side Performance Testing

Caching!

In computing, a cache (/ˈkæʃ/ KASH) is a component that stores data so future requests for that data can be served faster; the data stored in a cache might be the results of an earlier computation, or

the duplicates of data stored elsewhere.

Page 9: Client-side Performance Testing

Where can caching be done?

Page 10: Client-side Performance Testing

TYPICAL ARCHITECTURE

Improve user experience Reduce server load

Page 11: Client-side Performance Testing

WE WILL FOCUS ON

Improve user experience Reduce server load

Page 12: Client-side Performance Testing

Measuring Client-side Performance

Page 13: Client-side Performance Testing

MEASURING CLIENT SIDE PERFORMANCE

Synthetic Monitoring (& Testing)

Ø WebPageTest.org

Ø  SiteSpeed.io

Ø  ShowSlow

Ø Google PageSpeed

Page 14: Client-side Performance Testing

MEASURING CLIENT SIDE PERFORMANCE

Real User Monitoring

Ø  Akamai RUM

Ø Monitis RUM

Ø Google Analytics

Page 15: Client-side Performance Testing

WebPageTest.org

Page 16: Client-side Performance Testing

WEBPAGETEST – HOSTED SOLUTION

Advantages

Ø  Free to use

Ø  Global spread

Ø  Caters to current web development practices / approaches (responsive / lazy loading / etc.)

Page 17: Client-side Performance Testing

Lets Play!

Page 18: Client-side Performance Testing

IMPORTANT METRICS

What to Measure?

WebPageTest Metric

Explanation

First reaction

Time to First Byte (TTFB)

Time from the start of the initial navigation until the first byte of the base page is received by the browser (after following redirects).

Content appears

Time to Start Render

Time from the start of the initial navigation until the first non-white content is painted to the browser display.

Page processing completed

DOM Content Ready End

The point when the HTML parser has reached the end of the document which means it has executed any blocking scripts. The CSSOM may not be complete yet.

Full page loaded

Doc Complete Time

The onload event which fires when all of the scripts, css and images defined in the HTML have finished loading (including below-the-fold content).

Refer to WebPageTest documentation for more details: •  https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metrics •  https://sites.google.com/a/webpagetest.org/docs/advanced-features/raw-test-results

Page 19: Client-side Performance Testing

WEBPAGETEST – HOSTED SOLUTION

Disadvantages

Ø  Need to get in the queue of currently executing tests

Ø  Can run only against publically available URLs / pages

Ø  Limited automation using REST APIs

Page 20: Client-side Performance Testing

WEBPAGETEST – PRIVATE INSTANCE

Advantages

Ø  Free to use, Open-source

Ø  Can run multiple scenarios in parallel (limited by number of agents configured)

Ø  Can run against public and private available URLs / pages

Ø  Results available for as long as configured

Ø  There is no limit on number of tests run per day

Page 21: Client-side Performance Testing

WEBPAGETEST – PRIVATE INSTANCE

Disadvantages

Ø Need to setup the WPT server and WPT agents in our own infrastructure, or in AWS

Page 22: Client-side Performance Testing

WEBPAGETEST - AUTOMATION

Ø  REST API calls

Ø  Poll for results / implement call back

Ø  Parse summary / detail CSV file to do assertions / validations

Challenges

Ø Managing infrastructure

Ø  Polling for results can be time consuming and error prone

Page 23: Client-side Performance Testing

YSlow

Page 24: Client-side Performance Testing

YSLOW

Advantages

Ø  Simple to use (with phantomJS)

Ø  Gives reasonably decent information

Ø  Easy to hook with Continuous Integration (CI) Server

Page 25: Client-side Performance Testing

Lets Play!

Page 26: Client-side Performance Testing

YSLOW

Disadvantages

Ø OLD

Ø Does not consider lazy loading / responsive design

Page 27: Client-side Performance Testing

Google’s PageSpeed Score

Page 28: Client-side Performance Testing

Lets Play!

Page 29: Client-side Performance Testing

GOOGLE PAGE SPEED

Ø  De facto standard

Ø  Shows opportunities to increase page speed score

Ø  Works only for public URLs / pages

Page 30: Client-side Performance Testing

RESOURCES

Ø www.webpagetest.org

Ø  Page Speed

Ø  PhantomJS – YSlow

Ø  Sample automation –client-side-perf-tests

Page 31: Client-side Performance Testing

[email protected]

[email protected]

@BagmarAnand

about.me/anand.bagmar

THANK YOU