Skip to content

api & packages: rewrite hls parser with native rust module#1571

Open
thealexsan wants to merge 3 commits into
imputnet:mainfrom
thealexsan:feature/rust-hls-parser
Open

api & packages: rewrite hls parser with native rust module#1571
thealexsan wants to merge 3 commits into
imputnet:mainfrom
thealexsan:feature/rust-hls-parser

Conversation

@thealexsan

Copy link
Copy Markdown

No description provided.

@thealexsan

Copy link
Copy Markdown
Author

This PR replaces the CPU-heavy JavaScript hls-parser logic in internal-hls.js with a blazing-fast native Rust module (@imput/cobalt-rs-hls) using napi-rs and m3u8-rs.

Why? Parsing massive multi-megabyte HLS/DASH playlists for live streams (like Twitch or Bluesky) recursively in JavaScript blocks the event loop and heavily stresses V8's garbage collector. This native extension isolates that workload to a memory-safe, zero-copy Rust parser, dramatically improving proxy throughput. It preserves the exact same stream cache logic by calling synchronously back into Node.js.

@thealexsan thealexsan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Made it cross-platform

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