Skip to content

Realistic Page Load Time Test #10452

Open

Description

@shinglyu

I had some discussion with @larsbergstrom about this, and here is my proposal. Feedbacks welcome!


Goal

Measuring Servo's page load performance on top websites (e.g. Alexa 500), and comparing them to other browser's performance.

Existing Solutions

  • Firefox Desktop
    • Talos - tp5 suite
    • PerfHerder (dashboard)
  • Firefox OS
    • b2gperf (deprecated)
    • Raptor (dashboard)

Proposal

Measurements

  • Page load time
    • Using window.performance API
  • (Optional) Record profiling data during test

Test Environment

  • (By priority) Linux, OSX, Windows, Android, ARM embedded, other

Test Harness

  • Python test runner (unittest or py.test)
    • wpt-runner?
  • Test pages are served from a local server to minimize network latency noise
  • Use WebDriver to execute performance.timing and collect the results

Test Cases

  • tp5
    • 51 manully selected and cleaned site from Alexa top 500 April 8th, 2011
    • Outdated, but a good starting point
    • Served from local server
  • Web Page Replay
    • Record and replay Alexa top 500 sites
    • Need to select representitive pages (i.e. not login or landing page)
    • Need a lot of manual labor
    • We should also include target sites from our June release plan:
      • github.com
      • duckduckgo
      • hackernews
      • reddit

Visualization & Notificaion

  • Raptor
    • What we used in B2G
    • A drag-and-drop dashboard solution with influxDB backend
  • (Alternative) PerfHerder?
  • (Alternative) Another AreWe...Yet from scratch?
  • Automated regression identification and bug reporting

Plan

  • Phase 1:
    • Serve tp5 pages on a local server
    • Run Servo (Linux 64) against tp5 and collect performance.timing data
    • Push the data to an influxDB instance
    • Plot them in Raptor (hosted on heroku)
    • Run against nightly builds on a local Jenkins server
  • Phase 2:
    • Record selected Alexa 500 sites with Web Page Replay
    • Automate regression finding and bug reporting
    • Compare with Gecko
    • Integrate with existing Servo test infrastructure
  • Phase 3
    • Bring up more platforms

Activity

  1. autrilla commented on Apr 7, 2016

    @autrilla
    Contributor

    Is this something you plan on doing yourself, or are you looking for someone to work on this? If so, I'm interested :)

  2. larsbergstrom commented on Apr 7, 2016

    @larsbergstrom
    Contributor

    I'd be very interested in seeing page load time as the most important piece of information but also capturing the raw output of the profiling data. @rzambre and I are working on some patches to make that easier to grab for automated systems, which we hope to land very soon.

    The only other obvious piece of information that would be really helpful is the output of memory profiling, though I don't know how practical that is to collect for initial page load scenarios. @nnethercote can you comment on whether that would be a useful measure to track or if we need more steady-state browsing data?

    CC: @jgraham @jdm @metajack @Ms2ger @edunham whom I expect to have other feedback

    Thanks for writing this up - I'm very excited for this work!

  3. jgraham commented on Apr 7, 2016

    @jgraham
    Contributor

    So, generally the idea of using something like tp5 and measuring the load times seems like a sensible first step. I would encourage you to build as little infrastructure as possible though; we already have solutions for monitoring performance data and I suspect that anything you invent now will be about the same amount of effort to get working as reporting to perfherder, but will be more of a maintenance burden in the future. @wlach is the expert here and will be able to provide hints.

    For harnesses, wptrunner already provides a mechanism to launch servo, but that's pretty much all you'll be using in this case. It will be possible to adapt to your usecase, but if your plan is literally just to launch servo for each url and read the timing data from stdout (which seems like the easiest implementation for now), then it's probably overkill. I think just using purely custom python code is quite defensible. I would avoid unittest.

    I agree that in the future using recorded loads instead of static copies of sites will be a much better simulation of the real world.

  4. wlach commented on Apr 7, 2016

    @wlach

    Yeah, I'd really encourage you to consider using Perfherder, which not only solves the problem of storing and visualizing performance data but also acting on it. I've spent the last few quarters working on a performance sheriffing view, which we've been using for tracking regressions in Talos and other things:

    https://treeherder.mozilla.org/perf.html#/alerts?status=-1&framework=1

    Perfherder automatically detects regressions and provides a simple method for filing bugs on them based on a template. We'd probably need to make some minor adaptations to support Servo, but nothing major. I'm in the middle of a similar effort to make Perfherder a good solution for sheriffing AreWeFastYet data, which I think should cover most of your use case: http://wlach.github.io/blog/2016/03/are-we-fast-yet-and-perfherder/

    Submitting data to perfherder is not hard, all that is involved is creating a standard treeherder job and adding a "performance artifact" to it (there's plenty of sample code for this). We've used treeherder successfully with github projects before (bugzilla, gaia), so I don't see why Servo would be a problem.

  5. edunham commented on Apr 7, 2016

    @edunham
    Contributor

    I'm +1 on using perfherder, since you'll almost certainly get better support and performance with a tool that people focus on full time than a one-off competing with many other projects for my, Jack's, and Lars's time. @wlach, does perfherder expose a public API of the data it collects, as well as the built-in metrics visualization?

  6. nnethercote commented on Apr 8, 2016

    @nnethercote
    Contributor

    Memory usage on page load would be reasonably useful. Tracking that would be a lot better than tracking nothing.

  7. shinglyu commented on Apr 8, 2016

    @shinglyu
    ContributorAuthor

    Let me summarize the above discussion:

    • Use tp5 as a start point
    • Use a dead simple python script as test harness
    • Use Perfherder for data collection and reporting
    • Additional metrics we can collect:

    The technique used in AreWeSlimYet seems daunting to me, I'd appreciate if anyone can point me to any tool or document I can study.

    @autrilla : Any help would be most welcome :) I'll open a new repo for this project and try to merge it back when it's mature.

  8. shinglyu commented on Apr 8, 2016

    @shinglyu
    ContributorAuthor
  9. wlach commented on Apr 8, 2016

    @wlach
  10. shinglyu commented on Apr 11, 2016

    @shinglyu
    ContributorAuthor

    @wlach Thank you for your information, but I still don't understand how Perfherder works.

    • So is Perherder just a frontend, and it queries data from Perfherder?
    • The performance data is actually a bunch of build artifacts from a series of treeherder jobs, we just get them all using the treeherder API? Not aggregated to some database?
    • I don't have any experience in creating treeherder jobs, is there any documentation or previous patch I can follow?
    • Do I need to request special permission to run my custom treeherder job on the production server?

    Thank you!

  11. shinglyu commented on Apr 11, 2016

    @shinglyu
    ContributorAuthor
  12. wlach commented on Apr 11, 2016

    @wlach

    @shinglyu I think you figured this out for yourself, but yes, that's the guide to use for submitting data.
    It doesn't cover performance data specifically (at least not yet), but there is some good prior art in autophone that you can hopefully use as a reference:

    https://github.com/mozilla/autophone/blob/master/autophonetreeherder.py

    Since this is the first time we'll be submitting Servo data to treeherder, we'll also need to send revision information. There's some guidance on doing that in the submitting data document that you linked to. Eventually you might want to consider using TaskCluster for scheduling jobs and submitting data, which I believe might take care of some of those details for you.

    To answer your earlier questions, Treeherder/Perfherder does actually aggregate performance data in an easy-to-digest form, which is how we provide all the frontend views at https://treeherder.mozilla.org/perf.html

    My recommendation would be as follows:

    1. Bring up your own test server and create a test program to submit data to it (both revision, and job/performance data).
    2. Make your performance testing job submit data to your test server
    3. We give you credentials and you start submitting data to stage (https://treeherder.allizom.org) for a few weeks, just to make sure everything's working
    4. Once we're confident that your script is submitting good, reliable data, start submitting to treeherder production.
  13. shinglyu commented on Apr 12, 2016

    @shinglyu
    ContributorAuthor

    @wlach : Thanks a lot! I'll start step 1 and 2 and contact you when I'm ready for step 3. :)

  14. shinglyu commented on Apr 13, 2016

    @shinglyu
    ContributorAuthor

    Update: the test runner is almost ready https://github.com/shinglyu/servo-perf
    Some of the tp5 test case (those with complex js and many ad pics) will run forever even if I set -o output.png. And trying to close it with window.close() wrapped in setTimeout() doesn't work either. I'm trying to figure out the root cause and may force kill servo if it runs for too long.

  15. shinglyu commented on Apr 13, 2016

    @shinglyu
    ContributorAuthor

    @wlach : The treeherder-client on PyPi is not the latest version in tree. Also the sample code in the documentation is out of sync with the unit tests. Which version should I use to match the server version on stage and production?

  16. 33 remaining items

  17. shinglyu commented on May 13, 2016

    @shinglyu
    ContributorAuthor
  18. shinglyu commented on May 13, 2016

    @shinglyu
    ContributorAuthor

    In case you are confused, the May 10 commit is still using talos. I changed to servo-perf and break the code, so there are some missing data between May 10 and May 12. The first May 12 build is also broken, so the new clean data should start from the bca625b commit.

  19. wlach commented on May 13, 2016

    @wlach

    @shinglyu No the performance signature is distinct from the job_guid. The signature is calculated based on the properties of PERFHERDER_DATA (suite name, test name, options) as well as various reference data from the job (machine platform, options, ...). And yes, if you change the performance framework you'll get a new series (though the signature should remain the same, since performance framework is not currently incorporated into the signature).

  20. shinglyu commented on May 16, 2016

    @shinglyu
    ContributorAuthor

    @wlach: Thanks. Do the last 4~5 tests have the same signature? The only changing part should be the timestamp and performance numbers. I might have changed the subtest name when I fixed some bugs a week ago, but the latest 4 tests should be stable. Can you point me to the performance signature code/docs so I can double check?

  21. shinglyu commented on May 16, 2016

    @shinglyu
    ContributorAuthor

    @larsbergstrom @metajack I tried to prioritize the remaining work. Please let me know if we need to adjust anything.

    Priority 1 (Critial for June Preview)

    Prioirty 2 (Must have before, say, end of Q3 2016)

    Priority 3 (Nice to have)

    Edit: move automatic alert to P3

  22. wlach commented on May 16, 2016

    @wlach
  23. shinglyu commented on May 17, 2016

    @shinglyu
    ContributorAuthor

    @wlach: Thanks. So did you check the signature by manual querying it in the SQL DB or is it shown on the UI?

  24. highfive commented on May 25, 2016

    @highfive
  25. highfive commented on May 25, 2016

    @highfive
  26. added
    B-RFC
    on May 25, 2016
  27. jdm commented on May 31, 2016

    @jdm
    Member

    Out of curiosity, what will it take to allow measuring non-master branches? Once the off-thread HTML parsing work is ready, it would be useful to be able to compare the before and after timing before the changes are actually merged.

  28. autrilla commented on May 31, 2016

    @autrilla
    Contributor

    @jdm I don't think it would be very complicated at all. As far as I know currently we're still manually copying the servo binary to the performance test runner's directory, so it'd simply be a matter of adding the branch as a command line parameter to the runner, so that it gets sent as another treeherder project (or whatever they're called) and copying the servo binary from the other branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-profilingB-RFC

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions