Hmm.. let me walk through this and ask a few questions to clarify what you mean exactly.
Here's the rough idea how these Objects are created and associated with one another: pNode = new Object(); pNode->pL = pNodeA; pNode->pR = pNodeB; pNode->pU = pNodeC; pNode->pD = pNodeD; Questions: 1) Does this create 1 object and an additional 4 handles? 2) When pNode's links later change, will those handles (pL, pR, pU, pD) require garbage collection, or are they immediately destroyed? The links between objects may be possible to replace with integers, which then can be used to index into an array of Objects. Might that reduce the handle count? On Apr 9, 6:09 am, Erik Corry <[email protected]> wrote: > On Sun, Apr 8, 2012 at 7:03 AM, caustik <[email protected]> wrote: > > I have a large, fixed collection of objects which reference one > > another (e.g. linked list) > > > There are over 1,000,000 of these objects. I've noticed that the limit > > to my project's scalability is the garbage collection cycle which take > > a full second to run as a result of having this many object handles in > > the context. Normal operation is extremely fast, the only bottleneck > > is this traversal of these objects by garbage collection. I can try to > > avoid creating garbage, to limit how frequent this collection occurs, > > but it's inevitable to need GC at some point, and with these objects > > excluded, the GC pass would be extremely fast and no longer a > > bottleneck. > > > So, is there any existing technique I may use to exclude this set of > > objects from garbage collection? This would fix the bottleneck, and > > presumably this particular problem is applicable to a huge portion of > > (for example) node.js projects, thus solving one of the biggest > > hurdles against even more widespread adoption of V8 (GC is often the > > biggest performance bottleneck). > > Is it possible to avoid having so many handles? The GC can handle > lots of interlinked objects on the JS side without big pauses, but the > large number of handles is the issue. A solution that reduces the > large number of handles (and doesn't just create one huge array on the > JS side with all the references) will likely make pauses smaller. > > -- > Erik Corry -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
