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

Event loop scheduling improvement #282

Open
kateinoigakukun opened this issue Feb 7, 2025 · 0 comments
Open

Event loop scheduling improvement #282

kateinoigakukun opened this issue Feb 7, 2025 · 0 comments

Comments

@kateinoigakukun
Copy link
Member

kateinoigakukun commented Feb 7, 2025

Motivation

Think the following situation:

  1. The browser event loop has a pending event that fires an event listener that schedules high-priority work to JSKit's executor.
  2. But the current JSKit's executor loop does not yield its control to JS event loop until all enqueued works are done
  • Even if some of them are low-priority

It resulted in the higher priority works planned to be enqueued to JSKit's executor are blocked by lower priority works that are already enqueued even though browser engine knows about the pending event.

Outcome

  • Performance gain

Potential solution

Although yielding control to JS engine for every Swift job is not a realistic approach due to high overheads, but it's still considerable to yield control when certain time is spent for the current JSKit's executor loop.

@kateinoigakukun kateinoigakukun converted this from a draft issue Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant