Re: [v8-users] BSON to v8::Object performance issue

2017-11-17 Thread Jean-Marc Le Roux
Thank you! Great help here. Amazing folks! On Nov 17, 2017 6:21 PM, "J Decker" wrote: > > > On Fri, Nov 17, 2017 at 7:25 AM, Jean-Marc Le Roux < > jeanmarc.ler...@aerys.in> wrote: > >> My assumption is that my test app terminates before the GC has a chance >> to run. >> To test this: >> >>-

Re: [v8-users] BSON to v8::Object performance issue

2017-11-17 Thread J Decker
On Fri, Nov 17, 2017 at 7:25 AM, Jean-Marc Le Roux wrote: > My assumption is that my test app terminates before the GC has a chance to > run. > To test this: > >- I run node with the --expose-gc option >- I call global.gc() at the end of my test app > > In this case, the destructor of my

Re: [v8-users] BSON to v8::Object performance issue

2017-11-17 Thread Jean-Marc Le Roux
My assumption is that my test app terminates before the GC has a chance to run. To test this: - I run node with the --expose-gc option - I call global.gc() at the end of my test app In this case, the destructor of my ObjectWrap is indeed called. *So it seams the GC doesn't simply "collect

Re: [v8-users] BSON to v8::Object performance issue

2017-11-17 Thread Jean-Marc Le Roux
Thanks for the great help! I think it makes a lot of sense now. So I've extended ObjectWrap like so: class BSONObject : public node::ObjectWrap > { > private: > bson_t* _bson; > public: > BSONObject(bson_t* bson, Local tpl) : > _bson(bson) > { > Local obj = tpl->NewIns