Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazier init #417

Merged
merged 8 commits into from
Mar 13, 2023
Merged

Lazier init #417

merged 8 commits into from
Mar 13, 2023

Conversation

3v1n0
Copy link
Collaborator

@3v1n0 3v1n0 commented Mar 13, 2023

Try to reduce some initialization sync code that may lead to blocking UI.

Avoid performing multiple requests by cancelling previously received ones
Creating menu items and populating them can be quite expensive in GNOME
shell, since we may create many of them during the extension initialization
we could end up blocking the UI.

To avoid this, we can create multiple idles for each menu addition, one with
each priority that depends on the number of elements already queued for
addition, in this way the items are added in different main loop idle cycles
avoiding to fill our job queue with too many things to do each frame.

Helps with: #295
They may be added to the set in case they match service name
We can avoid doing it later by just not exposing the interfaces at all
No need to wait for hanging services forever, let's limit this to 5 seconds
We need to do chunked requests to avoid initialization slowdowns, and
apparently awaiting many promises here is not as good as expected and may
lead to hanging, while using a generator is better, so  let's do this.

This implies bumping the required eslint version, while the the minimum
shell version should be ok, because gjs in GNOME 3.34 required mozjs60,
while async generators are supported since mozjs55.

Helps with: #295
We're already depending on promises that implies going waiting anyways, so
we can avoid this.
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