-
Notifications
You must be signed in to change notification settings - Fork 28.6k
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
quic: start adding in the internal quic js api #53256
base: main
Are you sure you want to change the base?
Conversation
1babee6
to
9f2f600
Compare
d4ea9c3
to
f245d2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless a massive improvement is planned on WebStream, I would recommend not using them in this lower level. They are 1 order of magnitude slower than Node streams. Using them here would limit the applicability of our Quic implementation.
Just using functions and callbacks might even be faster.
Really interesting @jasnell . Just a reminder we have continued to apply fixes to your original attempt many of which probably still apply today (latest branch: https://github.com/HalleyAssist/node/commits/test_quic16/ - not everything in this branch is relevant). Some fixes could probably done better with more drastic changes, however they all represent observed leaks, infinite loops or crashes observed in our staging and pilot environments. Including yesterday a fix for blocking streams creating an infinite loop in |
lib/internal/quic/quic.js
Outdated
instance[kStats] = createStreamStats(handle.stats); | ||
instance[kState] = createStreamState(handle.state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me a bit nervous that these names are a single character apart. High chance of typos in future maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ignoring this comment, just plan to address it in a subsequent iteration
a8066cd
to
0253d2c
Compare
Updated the implementation fairly significantly here.
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
43b9dbe
to
e456620
Compare
This is generally ready to go except for the "Coverage" github CI tests. Working on increasing the test coverage now to the minimum that'll pass. |
aec7701
to
9dc124d
Compare
While the external API for QUIC is expected to be the WebTransport API primarily, this provides the internal API for QUIC that aligns with the native C++ QUIC components.
} | ||
} | ||
|
||
class Stream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend we call this QuicInternalStream
, otherwise this will quickly get confusing
* | ||
* If a string is given it will be encoded as UTF-8. | ||
* | ||
* If an ArrayBufferView is given, the view will be copied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy here would be problematic for perf reasons. Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely be changed to detach the underlying ArrayBuffer instead of copy. The issue is that we do not want the buffer to be mutated while it is pending to be sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a TODO so we don't forget?
While the external API for QUIC is expected to be the WebTransport API primarily, this provides the
internal API for QUIC that aligns with the native C++ QUIC components. This is the first of several PRs that will fill out this part of the implementation. The goal of doing this incrementally is to make things easier to review by doing it in smaller chunks