<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 2017-05-08 3:16 PM, Gregory Szorc
wrote:<br>
</div>
<blockquote
cite="mid:CAJTgH0k2WGFqmysYu2hy3e1RYAmSK9-PQsocOKtce8NsTnqtyg@mail.gmail.com"
type="cite">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Over the course of several weeks, I've been slowly
accumulating information on best practices and tips to help
us front-end engineers write code with lower risk for
introducing jank to the user.</div>
<div><br>
</div>
<div>I've published that information here: <a
moz-do-not-send="true"
href="https://developer.mozilla.org/en-US/Firefox/Performance_best_practices_for_Firefox_fe_engineers"
target="_blank">https://developer.mozilla.org/<wbr>en-US/Firefox/Performance_<wbr>best_practices_for_Firefox_fe_<wbr>engineers</a></div>
<div><br>
</div>
<div>I was originally collaborating with a few people on it in
a Google Doc, but it's stabilized enough now to post on MDN.
Do feel free to continue to add tips (or corrections!).</div>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>Thanks for putting this together, Mike!</div>
<div><br>
</div>
<div>This isn't discrediting your excellent work. But I feel like
I need to ask a question: how do we have machines identify when
best practices aren't being followed? After all, machines will
catch the failures they're taught to catch 100% of the time,
which is better than human code review will do. Would it be
possible to have features (possibly limited to debug builds)
that detect when bad patterns are being used and raise warnings
or errors? Or for things like detecting synchronous flushes we
could have the test harness automatically record the count and
annotate certain tests with an allowed value (kind of like how
reftest expectations work). Obviously some patterns are hard or
impossible to codify. But *anything* that we teach machines to
catch for us is one less thing for humans to worry about and
inevitably miss during code review.</div>
</blockquote>
<br>
I asked Mike if Gecko could assert when chrome code causes
synchronous flushes from requestAnimationFrame. He filed bug 1362163
to look into this.<br>
</body>
</html>