[vtk-developers] Re: significant slow-down (6x) ofvtkPiecewiseFunction::GetValue() with new pipeline
Lisa Avila
lisa.avila at kitware.com
Tue Nov 30 14:42:44 EST 2004
Hi Everyone,
Brad and I spent some time thinking about this issue today and have
determined that vtkPiecewiseFunction should behave like other data objects
- in other words, the GetWhatever() methods should not call Update(). So,
Brad is going to be removing the Updates, requiring the developer using the
class to instead call Update before doing the GetValue(), or GetSize(), etc.
For most users this will make no difference except to make the code faster.
That's because VTK itself doesn't have any
vtkSomethingToPiecewiseFunctionFilter classes (at least I don't believe so)
so the Updates aren't actually doing anything (other than determining that
no Update is necessary).
If you are using a pipeline to create your vtkPiecewiseFunction (maybe
folks at GE are doing this? I know some of these sorts of filters existed
there 6 years or so ago - don't know if they are still in use....) then you
should be careful to insert an Update() before using methods such as
GetValue() and GetSize(). If more than one value is queried, this will be
faster since Update only needs to be called once.
Lisa
At 07:37 AM 11/30/2004, Charl P. Botha wrote:
>On Sun, 28 Nov 2004 14:10:20 -0500, Brad King <brad.king at kitware.com> wrote:
> > Dean Inglis wrote:
> > > this is also the likely root of the slowdown seen with tests and
> > > examples using vtkSplineWidget, that I noted in a previous post:
> > >
> http://public.kitware.com/pipermail/vtk-developers/2004-October/002936.html
> > >
> > > vtkSpline relies on vtkPiecewiseFunction for most of its work.
> > > Hopefully someone working on the new pipeline can sort this out soon....
> >
> > You are correct, it is the root of the problem. I have been aware of
> > this problem for some time now. It is on my new pipeline to-do list. I
> > will get to it when I can.
>
>Brad, is it alright if I implement and checkin an "unsafe" GetValue()
>as Lisa suggested, e.g. something like UnsafeGetValue() or
>FastGetValue() that doesn't call update (because the user has), or
>does this conflict with the changes that you plan on making?
>
>--
>charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
>_______________________________________________
>vtk-developers mailing list
>vtk-developers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtk-developers
More information about the vtk-developers
mailing list