[ui] switch to asynch queue for trace loading#164
Merged
colin-grant-work merged 2 commits intosokatoafrom Nov 25, 2025
Merged
Conversation
Collaborator
Author
|
@cdamus, I was surprised to see that there wasn't an equivalent of an asynch queue already available in the utilities. Did I miss something? |
cdamus
requested changes
Nov 24, 2025
Collaborator
cdamus
left a comment
There was a problem hiding this comment.
Nice! Just a couple of quibbles in-line and this is the sort of thing for which we do generally add unit tests in Perfetto: generic utilities. Perhaps just ask an AI to scratch something up; it will do an amazing job of it.
ui/src/base/async_queue.ts
Outdated
| * | ||
| * @param work An async function to schedule. | ||
| * @returns A promise that resolves when either the task has finished | ||
| * executing, or after the task has silently been discarded because a newer |
Collaborator
There was a problem hiding this comment.
I thought the whole point is not to discard any task?
ui/src/base/async_queue.ts
Outdated
| @@ -0,0 +1,68 @@ | |||
| // Copyright (C) 2024 The Android Open Source Project | |||
cdamus
approved these changes
Nov 25, 2025
Collaborator
cdamus
left a comment
There was a problem hiding this comment.
Thanks! Love the tests 😀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
AsynchLimiterjust ignores tasks if it sees a queue. We want all the traces we ask for to actually load (probably - would be nice to have cancelation, but we don't), so this adds an asynch queueing implementation and uses that for trace loading instead of the limiter.To test:
Welcome to Perfetto!
Make sure your PR has a bug/issue attached or has at least
a clear description of the problem you are trying to fix.
For more details please see
https://perfetto.dev/docs/contributing/getting-started