quic|blob: Potentially improve createBlobReaderStream performance
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
I am currently looking at the quic implementation code (in order to use it for webtransport).
I have seen that the quic implementation uses createBlobReaderStream
https://github.com/nodejs/node/blob/6f941fcfba50fe7c3a342ed2066770aecaaa9b5a/lib/internal/blob.js#L435
for getting the readable.
I am wondering createBlobReaderStream recreates functions for every call to pull.
My experience with webstreams in the browser (also using V8) suggests that this potentially creates a large number of function objects on the stack.
So I wonder, if it is not better to move readNext up to the top closure of the function and pass the controller as an argument.
This may be important, if you run for example a video stream over a webtransport stream.
Or am I am missing something?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/internal/blob.js at createBlobReaderStream around line 435, then trace its use from the QUIC implementation. Measure whether the current pull-path function creation affects a representative streaming workload, and compare any proposed change. Done requires evidence that the change improves performance without altering stream behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- networking, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100