gecko-dev/browser/components/translation
Barret Rennie 46fd11fd0d Bug 1536170 - Replace Async.jankYielder r=tcsc,markh,eoger
`Async.jankYielder` is known to, unfortunately, cause jank by creating a lot of
immediately resolved promises that must be then GCed. For a collection of 50
items, it will create 50 promises and 49 of them will immediately resolve.

Instead of `Async.jankYielder`, we now have `Async.yieldState`, which simply
keeps track of whether or not the caller should yield to the event loop. Two
higher level looping constructs are built on top of it:

* `Async.yieldingIterator`, which has been rewritten to not create extraneous
  promises; and
* `Async.yieldingForEach`, which is a replacement for awaiting
  `Async.jankYielder` in a loop. Instead, it accepts the loop body as a
  function.

Each of these can share an instance of an `Async.yieldState`, which allows an
object with multiple loops to yield every N iterations overall, instead of
every N iterations of each loop, which keeps the behaviour of using one
`Async.jankYielders` in multiple places.

Differential Revision: https://phabricator.services.mozilla.com/D26229

--HG--
extra : moz-landing-system : lando
2019-04-17 03:00:35 +00:00
..
cld2
content Bug 1494948: Removed FX_PREFERENCES_OPENED_VIA probe and origin parameter for openPreferences r=jaws,chutten 2019-04-09 20:40:26 +00:00
test Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop 2019-03-28 09:38:14 +00:00
BingTranslator.jsm Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8 2019-01-30 17:26:25 +00:00
GoogleTranslator.jsm Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8 2019-01-30 17:26:25 +00:00
LanguageDetector.jsm Bug 1528751 - Add a custom eslint rule to check "consistent" if bracing. r=Standard8 2019-02-28 08:39:33 +00:00
moz.build Bug 1496827 - Remove the "notification" binding. r=bgrins 2018-11-13 12:56:42 +00:00
Translation.jsm Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
TranslationContentHandler.jsm Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
TranslationDocument.jsm Bug 1536170 - Replace Async.jankYielder r=tcsc,markh,eoger 2019-04-17 03:00:35 +00:00
YandexTranslator.jsm Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8 2019-01-30 17:26:25 +00:00