Skip to content

Improve ordering of resolving waitForBufferStatus calls#1877

Merged
lukasIO merged 16 commits intomainfrom
lukas/simple-mutex
Apr 14, 2026
Merged

Improve ordering of resolving waitForBufferStatus calls#1877
lukasIO merged 16 commits intomainfrom
lukas/simple-mutex

Conversation

@lukasIO
Copy link
Copy Markdown
Contributor

@lukasIO lukasIO commented Apr 9, 2026

No description provided.

@lukasIO lukasIO requested a review from 1egoman April 9, 2026 07:47
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 423cd2e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 95.52 KB (+0.08% 🔺)
dist/livekit-client.umd.js 104.3 KB (-0.05% 🔽)

@1egoman
Copy link
Copy Markdown
Contributor

1egoman commented Apr 9, 2026

@lukasIO As a heads up, I did some quick benchmarking and while this took about the same amount of time to run as my pull request, it results in a bit more of a variable delivery rate... I'm not exactly sure why though. The packet drops that occurred for in the context of both pull requests looked to generally be single packet drops for a data track frame.

This pull request:

Production:
Screenshot 2026-04-09 at 4 27 03 PM

Screenshot 2026-04-09 at 4 37 47 PM Screenshot 2026-04-09 at 4 39 13 PM

(I ran it ~10 times and forgot to take a screenshot, but saw one run go as low as a 20% delivery rate on the second low_fps_multi_packet test)

Staging:
Screenshot 2026-04-09 at 5 28 58 PM

Screenshot 2026-04-09 at 5 30 09 PM Screenshot 2026-04-09 at 5 31 35 PM

My pull request's current state (d1858ba), against production:

Screenshot 2026-04-09 at 4 41 12 PM Screenshot 2026-04-09 at 4 43 25 PM

Also for completeness, the below is my pull request pre introduction of the mutex (b7153a1) against production, which has roughly the same performance characteristics:

Screenshot 2026-04-09 at 4 46 50 PM Screenshot 2026-04-09 at 4 48 21 PM Screenshot 2026-04-09 at 4 50 40 PM

@lukasIO lukasIO changed the title Ensure strict ordering of resolving waitForBufferStatus calls Improve ordering of resolving waitForBufferStatus calls Apr 14, 2026
@lukasIO
Copy link
Copy Markdown
Contributor Author

lukasIO commented Apr 14, 2026

@1egoman I've updated this as discussed to only use the event without the mutex

Copy link
Copy Markdown
Contributor

@1egoman 1egoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks.

If you want to move your mutex additions into another pull request I think they still may be a good idea, but I want to have our data tracks meeting next week first before opting to potentially merge that.

@lukasIO lukasIO merged commit bdd3251 into main Apr 14, 2026
5 of 6 checks passed
@lukasIO lukasIO deleted the lukas/simple-mutex branch April 14, 2026 16: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.

2 participants