Repository navigation
Open
Labels
Description
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.performanceAPI
- Using
- (Optional) Record profiling data during test
Test Environment
- (By priority) Linux, OSX, Windows, Android, ARM embedded, other
Test Harness
- Python test runner (
unittestorpy.test)- wpt-runner?
- Test pages are served from a local server to minimize network latency noise
- Use WebDriver to execute
performance.timingand 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
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
- Use statistical rule to identify perf regressions
- Submit the regression bug to GitHub issues
Plan
- Phase 1:
- Serve tp5 pages on a local server
- Run Servo (Linux 64) against tp5 and collect
performance.timingdata - 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
autrilla commentedon Apr 7, 2016
Is this something you plan on doing yourself, or are you looking for someone to work on this? If so, I'm interested :)
larsbergstrom commentedon Apr 7, 2016
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!
jgraham commentedon Apr 7, 2016
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.
wlach commentedon Apr 7, 2016
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.
edunham commentedon Apr 7, 2016
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?
nnethercote commentedon Apr 8, 2016
Memory usage on page load would be reasonably useful. Tracking that would be a lot better than tracking nothing.
shinglyu commentedon Apr 8, 2016
Let me summarize the above discussion:
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.
shinglyu commentedon Apr 8, 2016
I started some experiment in this repo: https://github.com/shinglyu/servo-perf
wlach commentedon Apr 8, 2016
@edunham: Perfherder has a bunch of endpoints for getting series data (the UI uses these):
https://treeherder.mozilla.org/docs/#!/project/Performance_Datum_list
https://treeherder.mozilla.org/docs/#!/project/Performance_Signature_list
And also one to get a list of "alerts" (detected changes) programatically:
https://treeherder.mozilla.org/docs/#!/performance/Performance_Alert_Summary_list
Feel free to ask either me or jmaher on irc.mozilla.org #treeherder or #perfherder if you have more questions
shinglyu commentedon Apr 11, 2016
@wlach Thank you for your information, but I still don't understand how Perfherder works.
Thank you!
shinglyu commentedon Apr 11, 2016
Oh I found this: https://treeherder.readthedocs.org/submitting_data.html
Can I use this?
wlach commentedon Apr 11, 2016
@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:
shinglyu commentedon Apr 12, 2016
@wlach : Thanks a lot! I'll start step 1 and 2 and contact you when I'm ready for step 3. :)
shinglyu commentedon Apr 13, 2016
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 withwindow.close()wrapped insetTimeout()doesn't work either. I'm trying to figure out the root cause and may force kill servo if it runs for too long.shinglyu commentedon Apr 13, 2016
@wlach : The
treeherder-clienton 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?33 remaining items
shinglyu commentedon May 13, 2016
@wlach: Now the data points are in the same graph again. https://treeherder.allizom.org/perf.html#/graphs?series=[servo,f6067f4bc04fef24aa4eec8ff55794727bfe5f7f,1]&selected=[servo,f6067f4bc04fef24aa4eec8ff55794727bfe5f7f,9,17]
I assume the problem is because I'm transitioning from
talostoservo-perf?shinglyu commentedon May 13, 2016
In case you are confused, the May 10 commit is still using
talos. I changed toservo-perfand 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.wlach commentedon May 13, 2016
@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).
shinglyu commentedon May 16, 2016
@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?
shinglyu commentedon May 16, 2016
@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
wlach commentedon May 16, 2016
@shinglyu: Code for signature calculation is here (warning: it has some rough edges): https://github.com/mozilla/treeherder/blob/master/treeherder/etl/perf.py
shinglyu commentedon May 17, 2016
@wlach: Thanks. So did you check the signature by manual querying it in the SQL DB or is it shown on the UI?
highfive commentedon May 25, 2016
cc @aneeshusa
highfive commentedon May 25, 2016
cc @fitzgen
jdm commentedon May 31, 2016
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.
autrilla commentedon May 31, 2016
@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.