Accessing TypedArrays is at least as fast as accessing regular JSArrays,
since they never contain holes and the optimizing compiler knows what types
to expect from their elements. Basically the recently introduced special
handling of SMI arrays without holes is an attempt to get them closer to
TypedArray performance.

Note that TypedArrays (a.k.a. "external arrays") are not defined in V8
itself. They are implemented by the embedder, e.g. the developer shell "d8"
or the WebKit V8 bindings. Look at these two examples for how to do that.


On Sat, Jun 16, 2012 at 5:44 PM, Pablo Sole <pablo.s...@gmail.com> wrote:

> Hello there,
>
> I'm embedding v8 into a binary instrumentation framework and I'm trying
> to use an ArrayBuffer/TypedBuffer for fast memory operations (like
> Tamarin/ActionScript does for the Memory object operations), but I
> couldn't find any fast access defined in the JIT compiler, so I suppose
> that a read/write to a TypedBuffer goes all the way of an object and
> property resolution. Although, for this case it could just be a range
> check and a memory load/store operation.
>
> So, would it be faster to use a regular array of SMIs (SMIs in the
> indexes and in the values) without holes faster than an ArrayBuffer? Is
> there any plan to provide a fast path for this case?
>
> Thanks,
>
> pablo.
>
>

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

Reply via email to