resourceloader: Misc optimisations in startup module
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 8 Feb 2019 23:54:44 +0000 (23:54 +0000)
committerKrinkle <krinklemail@gmail.com>
Sat, 9 Feb 2019 01:53:59 +0000 (01:53 +0000)
commite6379248987f4ee86cd37fb8e13482dc19c4fc95
treed773fab0e7a34b263840ac2b104fd3f5d70cd936
parentcb73d93711b94bc3e174bad296a64205999fa67d
resourceloader: Misc optimisations in startup module

* Remove redundant trackQueue var.
* Simplify logError() code, and remove some local vars.
* Simplify Map#set() code.
* Simplify performance.now check. There are no known browsers,
  supported and unsupported, in which this property is existant
  as anything other than a function.
* Optimised baseModules iteration in sortDependencies().
  Slightly shorter and slightly faster as for-loop.
* Omit trailing dot from error message in one case.
  (None of the other error messages had trailing dots.)
* Add missing space to error message for mainScript.
* Simplify splitModuleKey() code.
* Remove redundant quotes in mw.loader.store.set() for encodedScript.

Differences in response body size on stock MediaWiki.

> uncomp 42152 - 41984 = 168 bytes saved.
> gzip-1 15437 - 15364 =  73 bytes saved.
> gzip-9 13506 - 13419 =  87 bytes saved.

Change-Id: I54c9ab30522c36ece054b915809fe20bff6867b3
resources/src/startup/mediawiki.js