Closed tunetheweb closed 3 months ago
@brendankenny upon suggestion from @rviscomi I'm initialising the three formatters needed up front once, rather than each time the metric changes.
As the extension is only initialised after the document is complete
there's a bigger chance it's idle then (not guaranteed, but best chance) so initialising the NumberFormat then (and only then) is best place to init it.
WDYT?
Issue raised in https://github.com/GoogleChrome/web-vitals-extension/pull/178#discussion_r1593065236
This initialised the formatters once as the extension is initialised, rather than with each metric update for a god performance improvement, but also allows us to keep the INTL option.