On Tuesday, November 12, 2013 12:08:28 AM UTC-8, Dmitry Lomov wrote:
>
> These implementations feature faster allocation, better garbage collection 
> performance and a potential to become even faster in the future with deep 
> compiler optimizations - they are the finest available.
>

Except they are at least twice as slow as our Node's internal Buffer 
implementation for allocations over 1KB. I've been on the receiving end of 
much debate about why Node doesn't transition to using ArrayBuffers and the 
bottom line is always performance. Other than the fact that instantiating 
an ArrayBuffer is slower, there's the lost consideration of then needing to 
turn that into a Uint8Array before it's usable.

What I feel you're considering a nuisance, being able to set external data 
to any object, has been an excellent feature. With the release of Node 
v0.12 there's a new API that'll allow users to roll out their own 
Buffer-like classes. Making it easy to extend a constructed instance with 
data and easily exposing a set of methods to work with the data. I myself 
have been using this as a simplified way to create mathematical API's 
around the object's instance directly. Instead of needing to pass around an 
Type Array View.

We use it extensively as an extremely light weight way of sharing state 
between C++ and JS. Currently it's ridiculously slow to read Object 
properties from a JS Object in C++, so a technique has been used where a 
struct is wrapped around a set of data in C++ and that same data is 
attached to an Object in JS. This way they can communicate as quickly as 
possible. This has allowed significant performance gains. When the Function 
is a singleton it's also useful to attach the memory directly to the 
Function instead of an Object somewhere close by.

IMO removing these would be a significant step backwards.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" 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/groups/opt_out.

Reply via email to