-
-
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58058 +/- ##
==========================================
+ Coverage 90.18% 90.21% +0.03%
==========================================
Files 630 630
Lines 186393 186410 +17
Branches 36595 36612 +17
==========================================
+ Hits 168103 168175 +72
+ Misses 11090 11058 -32
+ Partials 7200 7177 -23
🚀 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
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.
Great work.
b28834c
to
2841143
Compare
2841143
to
ab8d328
Compare
auto buffer_ = buffer.As<v8::TypedArray>()->Buffer(); | ||
auto buffer_data = buffer_->Data(); | ||
return simdutf::validate_utf8(reinterpret_cast<const char*>(buffer_data), | ||
buffer_->ByteLength()); |
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 doesn't account for any offset on the backing ArrayBuffer. ArrayBufferViewContents
is probably needed here.
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/