Requests for comment/Performance standards for new features

It would be nice to be able to define a codified set of minimum performance standards that new MediaWiki features must meet before they can be deployed to larger Wikimedia sites such as English Wikipedia, or be considered complete.

Background
Originally from a wikitech-l discussion. Right now, varying amounts of effort are made to highlight potential performance bottlenecks in code review, and engineers are encouraged to profile and optimize their own code. But beyond "is the site still up for everyone / are users complaining on the village pump / am I ranting in irc", we've offered no guidelines as to what sort of request latency is reasonable or acceptable. If a new feature (like aftv5, or flow) turns out not to meet perf standards after deployment, that would be a high priority bug and the feature may be disabled depending on the impact, or if not addressed in a reasonable time frame. Obviously standards like this can't be applied to certain existing parts of mediawiki, but systems other than the parser or preprocessor that don't meet new standards should at least be prioritized for improvement.

How it could look like
If we set some measurable standards (numbers are just examples):
 * p999 (long tail) full page request latency of 2000ms
 * p99 page request latency of 800ms
 * p90 page request latency of 150ms
 * p99 banner request latency of 80ms
 * p90 banner request latency of 40ms
 * p99 db query latency of 250ms
 * p90 db query latency of 50ms
 * 1000 write requests/sec (if applicable; writes operations must be free from concurrency issues)

And/or less metrical things:
 * guidelines about degrading gracefully
 * specific limits on total resource consumption across the stack per request
 * etc.

Scope and issues
Things to address, or to exclude from the scope of the RfC.
 * Metrics, if any, should be actually measurable by devs.
 * Otherwise it can only be after-the-fact measuring by "performance experts".
 * Can make people more confident about +2; especially volunteers are often stuck for months with unactionable performance concerns.
 * At what point to measure, e.g. from backend perspective or transcontinental user's point.
 * Not everything can be measured. Define a process/safety net to detect performance regressions/fiascos caused in ways nobody thought of, e.g. critical areas of the code/features/kinds of changes which need to be reviewed in some particolar way or triple-checked (by some particular people?).
 * An actual testing/measuring playground to replicate realistic conditions (e.g. wiki datasets size, replag, job queue, network topology, ...).
 * Beta cluster?
 * MediaWiki-Vagrant??
 * Testing in production? Gradual deploy.
 * Beta Features?
 * Educational/help material: could be a byproduct to assist a "policy", or the actual outcome of the RfC.
 * For devs: "like understanding if algorithms or queries are O(n) or O(2^n)".
 * For professional and amateur sysadmins: "coherent documentation on how to improve performance of a MediaWiki site at all levels" now completely missing.