I'm trying to improve some serialization code in NodeJS and was wondering if this could be achieved by going down to the native code and using multiple threads to parallelize the serialization of multiple objects. For example, imagine we need to serialize 1K objects to JSON/OtherFormat - split into 4 x 250 batches and use 4 (non-main) threads to serialize the objects, then gather the results and return. However, I'm having a bit of a hard time understanding a few concepts:
1. when does the GC kick in for an Isolate? my understanding is that any V8 code executed in an Isolate can trigger GC for that Isolate - is this correct?
2. when GC triggers, what happens to pointers that might have been extracted from Handle<Object> and the Handle is still in scope?
HandleScope scope(isolate);
Handle<Object> foo = ...
Object* fooPtr = *foo;
someCallThatTriggersGC()
// is fooPtr still valid???