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

Bad task scheduling due to lack of priority #279

Open
Zeblote opened this issue May 12, 2024 · 2 comments
Open

Bad task scheduling due to lack of priority #279

Zeblote opened this issue May 12, 2024 · 2 comments

Comments

@Zeblote
Copy link
Collaborator

Zeblote commented May 12, 2024

Here's an example. CM and ABP tasks are scheduled at roughly the same time. CM task is usually quite fine grained, while ABP has few very long ones. But the engine has no way to know this! So it often schedules them terribly.

image

We can fix this by letting the engine know the ABP task has higher priority. Here's the result of passing ETaskPriority::High to new UE::Tasks API in Unreal for ABP tasks only.

image

I only implemented the API necessary to get the info to Unreal, not in the default task scheduler, so it's probably not worthy of a PR as is.
brickadia@cde092e

@Zeblote
Copy link
Collaborator Author

Zeblote commented May 12, 2024

On that note, I'm wondering if it is possible to further split the PABP tasks. It seems like the dynamics (full) one is constantly taking much longer than the others, but I don't really understand the internal code that well.

@PierreTerdiman
Copy link

Thank you for the report. This is interesting, and I think we could try that in our own benchmarks. AFAIK the scheduler does not support task priorities so we would need to implement that first.

There is currently no way to further split the PABP tasks. This is possible in theory though, and there is / was some experimental code doing just that a while ago. But it has never been productized (IIRC it introduced more task-related overhead, to the point that only really large scenes showed benefits). It would be interesting to revisit this, but this is probably not a high-priority task.

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

No branches or pull requests

2 participants