-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
buffer: remove Uint8Array check #11324
Conversation
This makes write[U]Int* operations on Buffer with `noAssert=false` about 3 times faster. Refs: #11245
This would be a major change, as it changes the error message. |
@thefourtheye It removes the error message. I don't think this should be semver-major, it's semver-minor at most. I find it hard to imagine code that relies on this exception. |
@@ -1056,8 +1056,6 @@ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { | |||
|
|||
|
|||
function checkInt(buffer, value, offset, ext, max, min) { | |||
if (!isUint8Array(buffer)) |
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 buffer
is no longer checked we can just pass buffer.length
down. Not sure about the performance implication though.
There have been cases in the past where removal of an error has caused things to break. I'm going to agree with semver-major on this but we can see how the rest of @nodejs/ctc feels. |
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 change itself LGTM but I'd like discussion about the semver-iness of this before it lands.
I don’t think any usage that would have triggered the error can reasonably be considered part of our API, so I don’t think this a change that needs a semver label. |
Could you describe some of them in more detail? |
Just to be sure, we can have a CITGM run. |
@thefourtheye Could you run it? Last time I tried it, everything broke. |
@seishun Started. https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/573/. I hasn't succeeded in the recent past. Let's see. |
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.
Personally I don't think this needs to be semver-major.
@nodejs/citgm this citgm run crashed and burned, do we know what's going on here? |
@seishun why was this landed with so many failures on citgm that had not yet been reviewed? |
@MylesBorins do you have the time to review the failures in CITGM? |
CITGM again since the previous link is dead already: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/603/ |
A lot of red in CITGM, the error in expressjs seems the root issue.
cc: @mscdex @MylesBorins |
This isn't cherry-picking cleanly to v7.x-staging. Want to backport? |
Should this be backported to LTS? If yes please follow the guide and raise a backport PR, if no let me know or add the |
This makes write[U]Int* operations on Buffer with
noAssert=false
about 3 times faster.See #11245 (comment) for background and benchmark results.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
buffer