On Sun, Oct 2, 2016 at 6:39 PM, mh <[email protected]> wrote:
> Consider
>         v8ObjectTemplate templ = ObjectTemplate::New(isolate);
>         templ->SetInternalFieldCount(100);
>         v8Object obj = templ->NewInstance(context).ToLocalChecked();
>
> 'obj' is stored as a Persistent on the heap. The plan is to keep
> additional Values stored as internal fields. Some of these may be Reset()
> which means house-keeping code for a list of available indices.
>
> Questions:
>
> 1) Will this scheme degrade GC performance as opposed to having separate
> Persistent handles for all of these additional Values?

It's probably a little more efficient than separate Persistent handles
unless the internal fields array is large but sparse (i.e., when only
a fraction of the elements are in use.)

> 2) What is limit on the number of internal fields?

It should be large enough for your purposes.  The theoretical limit is
2^30, the effective limit is what fits on the JS heap.

-- 
-- 
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/d/optout.

Reply via email to