-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
buffer: add fast api for isAscii & isUtf8 #58058
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
base: main
Are you sure you want to change the base?
Conversation
6bb4020
to
8432a57
Compare
@@ -1175,6 +1175,28 @@ void Swap64(const FunctionCallbackInfo<Value>& args) { | |||
args.GetReturnValue().Set(args[0]); | |||
} | |||
|
|||
bool FastIsUtf8(v8::Local<v8::Value>, | |||
const v8::FastApiTypedArray<uint8_t>& 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.
I believe FastApiTypedArray
is on the way out? (#55452)
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.
We can move to Local once V8 removes it
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.
That moment is now: it is not present in V8 13.6, and #57753 is removing all remaining uses of it across the codebase.
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.
Ah, I'll update the implementation. Nice catch. Thanks @Renegade334
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58058 +/- ##
==========================================
+ Coverage 90.18% 90.21% +0.02%
==========================================
Files 630 630
Lines 186393 186406 +13
Branches 36595 36614 +19
==========================================
+ Hits 168103 168163 +60
+ Misses 11090 11059 -31
+ Partials 7200 7184 -16
🚀 New features to boost your workflow:
|
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.
lgtm
Adds v8 fast api for IsUtf8 and IsAscii methods
isAscii benchmark: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1706/
isUtf8 benchmark: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1708/