resourceloader: Optimise mw.now() definition
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 8 Sep 2018 18:32:18 +0000 (19:32 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 8 Sep 2018 21:45:03 +0000 (22:45 +0100)
commit7c66b040048874513722aedcd22eb30ce9169214
tree4db6202cff28a6aa0b602e23db51660acffbc14b
parent4b069cdc1e4b408f240551be33940b751035d437
resourceloader: Optimise mw.now() definition

In a microbenchmark this wouldn't register given it's just property
access, but the 'timing' and 'navigationStart' properties are
non-trivial getter accessors on their first call, and that's worth
deferring to when it is needed, instead of blocking the definition
of mw.loader early on.

Also remove the redundant wrapper around Date.now(), which is a
static and otherwise detachable function, it does not need to
be bound or wrapped. jQuery defines its shortcut the same way,
as `jQuery.now = Date.now`.

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