Does anyone know why *V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP*, by default, set to 64? This value seems rather low. Can we raise raise this to *kMaxRegularHeapObjectSize*?
I've been working on improving the performance of *TypedArray#subarray*, this lead me to improve the performance of supporting builtins ( *CreateTypedArray* and *TypedArrayInitialize*). I accidentally ignored *V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP*, and noticed a significant performance improvement to various TypedArray js-perf benchmarks (3x *SliceNoSpecies*, 2x *ConstructAllTypedArray*). Did some digging on the origin of this limit, introduced back in 2014: https://codereview.chromium.org/150813004/ . I didn't see much discussion how this low value was determined. Maybe assumptions back then have changed since then? *V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP* does not seem to be customized by Chrome, so I assume it's being defaulted to 64. As for Node, this does seem to be important for turning off TypedArray on-heap allocations completely ( https://chromium-review.googlesource.com/c/v8/v8/+/962243/). Considering these 2 use-cases, I wonder if this build time config should not be value but flag to turn on or off TypedArray on-heap allocations (ex. *V8_USE_ON_HEAP_TYPED_ARRAY_ALLOCATION*) Tangentially, perhaps some of the performance difference with on/off-heap TypedArray allocation because off-heap is going through an expensive CallJS ( https://cs.chromium.org/chromium/src/v8/src/builtins/builtins-typed-array-gen.cc?q=typed-array-gen.cc&sq=package:chromium&g=0&l=301-303), which could be mitigated with an external reference, fast-c call. In summary, looking for thoughts on whether this limit can be increased for performance. If not, what sets TypedArrays apart from other objects that use/base-off-of *kMaxRegularHeapObjectSize *as a limit? If so, should we just change to build time flag to be an on/off (not a number value). Off - for Node, On - for Chrome and default to *kMaxRegularHeapObjectSize?* Thanks! (cc-ing folks that are referenced in the above links) -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
