-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
perf(ext/web): optimize transferArrayBuffer #16294
Conversation
ext/web/06_streams.js
Outdated
O[isFakeDetached] = true; | ||
return transferredIshVersion; | ||
const v = ops.op_transfer_arraybuffer(O); | ||
v[isFakeDetached] = true; |
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.
v[isFakeDetached] = true; | |
v[isFakeDetached] = true; | |
return v; |
CI is failing because v
is not being returned.
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.
Lines 196 to 198 in 2300a70
function isDetachedBuffer(O) { | |
return ReflectHas(O, isFakeDetached); | |
} |
And maybe we can now change that method to:
function isDetachedBuffer(O) {
return O.byteLength === 0;
}
Although it may trigger some false positives.
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'm keeping isFakeDetached
to not touch a lot of code.
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'm keeping
isFakeDetached
to not touch a lot of code.
Could you fix this properly rather than half fixing it just enough so that WPT passes? 😉
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.
@lucacasonato #16307 @marcosc90 opened a PR to do that as a follow up to this one.
underlyingSourceDict = webidl.converters.UnderlyingSource( | ||
underlyingSource, | ||
{ prefix, context: "underlyingSource" }, | ||
); | ||
} |
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.
if (underlyingSource === undefined) {
underlyingSource = null;
}
This check is now not present at all anymore. underlyingSource
is passed to a child function further down.
#16307 has landed, please rebase this PR @littledivy |
Avoid copying enqueued data + misc optimizations to skip webidl converter.
10k rps increase in the SSR benchmark: