[vtk-developers] vtkGarbageCollector performance

David Gobbi david.gobbi at gmail.com
Thu Feb 3 15:29:14 EST 2011


I'm not a GC expert, but I can talk about VTK_LEAN_AND_MEAN.
It's main purpose is to remove vtkDebugMacro, i.e. by making it into
a no-op. But there might be other places that it's used, too.

On Thu, Feb 3, 2011 at 12:41 PM, Sean McBride <sean at rogue-research.com> wrote:
>
> Ken,
>
> Thanks for this suggestion.
>
> I'd still like to know if anyone knows what the deal with
> VTK_LEAN_AND_MEAN is.
>
> In any case, attached is a patch that improves the gc performance a
> little bit. There are basically two changes:
>  1- wrap some code in VTK_LEAN_AND_MEAN
>  2- don't evaluate end() every time through loops
>
> No tests started failing, but I'm not sure #2 is correct everywhere
> since it does change semantics a bit.
>
> Anyone familiar with vtkGarbageCollector???
>
> Cheers,
>
> Sean
>
>
> On Wed, 2 Feb 2011 10:42:33 -0700, Moreland, Kenneth said:
>
> >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?



More information about the vtk-developers mailing list