[vtk-developers] vtkGarbageCollector performance

Moreland, Kenneth kmorel at sandia.gov
Wed Feb 2 12:42:33 EST 2011


If you have a section of code that destroys several objects that invoke the garbage collector, then you can temporarily suspend garbage collection until you are finished with the bulk of deletions.  Thus, you can replace the many passes of the garbage collector with one single pass.  To do that, use the static methods vtkGarbageCollector::DeferredCollectionPush() and vtkGarbageCollector::DeferredCollectionPop().

-Ken


On 2/1/11 5:14 PM, "Sean McBride" <sean at rogue-research.com> wrote:

Hi all,

We've been profiling our app and finding that lots of time is spent in
VTK's garbage collector.

Part of the problem is that we are creating too many temporary objects,
but I still wanted to investigate a little to see if there are any
obvious improvements to be had in vtkGarbageCollector itself.

One thing I noticed is that some code is conditionalised with #ifdef
VTK_LEAN_AND_MEAN.  Yet I can't seem to find where VTK_LEAN_AND_MEAN is
set on or off (except in vtkWinCE.h, which shouldn't apply to me).
What's it for?  Where should I be turning it on?

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers





   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110202/195c2096/attachment.html>


More information about the vtk-developers mailing list