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

fix: perf: faster stream resolution #2607

Merged
merged 5 commits into from
Jul 5, 2023

Conversation

ThaUnknown
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)
This fixes an issue that caused iterators to sometimes hang for a very long time, and also cleans up some code.

The notify() function wasn't called for each piece [I think....] which caused the streams to sometimes hang for a very long time before being resolved, this was simply annoying and I shiver at the thought of how long this issue has existed, since this code was originally copied from file streams.

This creates a lot of event calls since it's now done for all pieces, not just the ones we're interested in, but speeds up streams a lot.

@ThaUnknown ThaUnknown enabled auto-merge (squash) July 5, 2023 09:13
Copy link
Member

@SilentBot1 SilentBot1 left a comment

Choose a reason for hiding this comment

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

Looks good to me, though we should probably add torrent.on('verified', (index)=>{}) as a new event in the API docs before merging.

@ThaUnknown ThaUnknown merged commit e692270 into webtorrent:master Jul 5, 2023
5 checks passed
webtorrent-bot pushed a commit that referenced this pull request Jul 5, 2023
## [2.1.12](v2.1.11...v2.1.12) (2023-07-05)

### Bug Fixes

* perf: faster stream resolution ([#2607](#2607)) ([e692270](e692270))
@webtorrent-bot
Copy link
Collaborator

🎉 This PR is included in version 2.1.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants