Closed Bug 1434615 Opened 7 years ago Closed 7 years ago

Schemas.jsm seems to be doing startup main thread IO with NetUtil.asyncFetch

Categories

(WebExtensions :: Untriaged, enhancement)

enhancement
Not set
normal

Tracking

(Performance Impact:?)

RESOLVED WONTFIX
Performance Impact ?

People

(Reporter: florian, Unassigned)

Details

https://perfht.ml/2rSUPsN is a startup profile where NetUtil_asyncFetch called by readJSON from resource://gre/modules/Schemas.jsm seems to be doing main thread I/O. https://groups.google.com/forum/#!topic/mozilla.dev.platform/_N88WYP4ZmQ was saying: "Q: Aren't NetUtils.asyncFetch and NetUtils.asyncCopy sufficient? A1: Most uses of NetUtils.asyncCopy I have seen seem to actually perform some main thread file I/O behind the scenes." So NetUtil_asyncFetch being something to avoid doesn't seem to be something new. Could https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API be used instead? While it's not visible in my profile, https://searchfox.org/mozilla-central/rev/c56f656febb1aa58c72b218699e24a76425bd284/toolkit/components/extensions/Extension.jsm#410 seems to have the same code.
This code is only used when the schema data isn't already in the startup cache, and there's already a bug to fix asyncFetch to not do main thread IO for jar channels.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Toolkit → WebExtensions
Performance Impact: --- → ?
Whiteboard: [qf]
You need to log in before you can comment on or make changes to this bug.