Skip to content

perf: don't block onload on Bases registration - #2187

Open
tgrosinger wants to merge 1 commit into
callumalpass:mainfrom
tgrosinger:perf-blocking-onload
Open

perf: don't block onload on Bases registration#2187
tgrosinger wants to merge 1 commit into
callumalpass:mainfrom
tgrosinger:perf-blocking-onload

Conversation

@tgrosinger

Copy link
Copy Markdown
Contributor

registerBasesTaskList retried registration five times with 200ms sleeps when the Bases plugin had not finished loading, and onload awaited the whole thing. On mobile, where plugin load ordering is less predictable, that could stall plugin startup for a full second.

registerBasesIntegration already owns retrying: it schedules a timer that re-attempts until the views are actually registered, checks the Bases plugin is enabled before each try, and is torn down on unload. So drop the inner loop entirely and make registerBasesTaskList a single attempt that reports its result, leaving one retry mechanism instead of two. onload no longer awaits it either.

registerBasesTaskList retried registration five times with 200ms sleeps
when the Bases plugin had not finished loading, and onload awaited the
whole thing. On mobile, where plugin load ordering is less predictable,
that could stall plugin startup for a full second.

registerBasesIntegration already owns retrying: it schedules a timer
that re-attempts until the views are actually registered, checks the
Bases plugin is enabled before each try, and is torn down on unload.
So drop the inner loop entirely and make registerBasesTaskList a single
attempt that reports its result, leaving one retry mechanism instead of
two. onload no longer awaits it either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant