mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
buffer: make indexOf(byte) faster
Add a V8 fast API implementation for indexOfNumber, which significantly improves the performance of finding a single byte within a buffer. Refs: https://github.com/nodejs/node/pull/52993 PR-URL: https://github.com/nodejs/node/pull/53455 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
1 parent
1aa8a785be
commit
103623b5ae
2 files changed
+54
-21
No files matched your search
@@ -41,6 +41,12 @@ using CFunctionCallbackWithTwoUint8ArraysFallback =
|
||||
const v8::FastApiTypedArray<uint8_t>&,
|
||||
const v8::FastApiTypedArray<uint8_t>&,
|
||||
v8::FastApiCallbackOptions&);
|
||||
using CFunctionCallbackWithUint8ArrayUint32Int64Bool =
|
||||
int32_t (*)(v8::Local<v8::Value>,
|
||||
const v8::FastApiTypedArray<uint8_t>&,
|
||||
uint32_t,
|
||||
int64_t,
|
||||
bool);
|
||||
using CFunctionWithUint32 = uint32_t (*)(v8::Local<v8::Value>,
|
||||
const uint32_t input);
|
||||
using CFunctionWithDoubleReturnDouble = double (*)(v8::Local<v8::Value>,
|
||||
@@ -68,6 +74,7 @@ class ExternalReferenceRegistry {
|
||||
V(CFunctionCallbackWithStrings) \
|
||||
V(CFunctionCallbackWithTwoUint8Arrays) \
|
||||
V(CFunctionCallbackWithTwoUint8ArraysFallback) \
|
||||
V(CFunctionCallbackWithUint8ArrayUint32Int64Bool) \
|
||||
V(CFunctionWithUint32) \
|
||||
V(CFunctionWithDoubleReturnDouble) \
|
||||
V(CFunctionWithInt64Fallback) \
|
||||
|
||||
Reference in new issue
Block a user