Up to now i have been using instance_t = t->InstanceTemplate() to add the
object members and this way I was able to cache the ObjectTemplate for creating
other similar objects.
This gave me a good performance boost from manually adding each member on every
object created (objects may have *100+ members this is predefined*).
If i understand correctly any members on the ObjectTemplate are subsequently
copied to the Object created with instance_t->NewInstance()
a) is there any difference when using t->GetFunction->NewInstance() to
instantiate my objects in comparison to t->InstanceTemplate()->NewInstance()
b) i have been experimenting using proto_t = t->PrototypeTemplate() to add the
members.
i) using this i have to use info.This() instead of info.Holder() to access
the GetAlignedPointerFromInternalField()
ii) also using proto_t->SetCallAsFunctionHandler() does not give the same
results as instance_t->SetCallAsFunctionHandler()
iii) are the members added to proto_t also copied the object or are they
somehow referenced (i.e. existing only once)?
iv) should there be any performance gain from using proto_t instead of
instance_t (because i don't see any from my tests)
c) so for instance if i have a loop creating 100 such objects with a 100
members each,
and the only difference of these objects would be the pointer in
GetAlignedPointerFromInternalField()
what is the most efficient way to instantiate these objects avoiding
duplication ?
Thanks
--
--
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.