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

perf: chunk and process playback segments concurrently #3663

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

boenshao
Copy link

The /list API can be a bit slow when there are lots of recordings that need to be processed.

The concatenation procedure can be split up and executed concurrently (and even parallelly).

I hard-coded the splits into 4, as most modern platforms have at least 4 cores.

But it's possible to introduce a more sophisticated way to determine the preferred number, either by the number of files or the total size of the files. We can gather the statistics in os.Walk.

Yet I believe the overhead of goroutine is negligible in most cases, so a static strategy is probably alright.

With this patch, on my AlderLake laptop, the response time is about 3x faster when parsing 2X GBs of recordings.

@boenshao boenshao force-pushed the perf/optmize-playback-list branch 3 times, most recently from ed0caa0 to 2a8b2f1 Compare August 16, 2024 15:32
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