[vtkusers] value-based vtkExtractSelection
David E DeMarle
dave.demarle at kitware.com
Mon Feb 25 12:04:03 EST 2013
This came up once before.
The values selection extraction code path was optimized for the use case of
extracting relatively long lists of values. Before doing the seek it sorts
the data and the list. The sort is slow, but once done, the seek is fast
and with a long list the cost is amortized and you end up winning overall.
With a small list you don't.
The thresholds code path wasn't optimized, so for small lists it is faster.
David E DeMarle
21 Corporate Drive
Clifton Park, NY 12065-8662
On Mon, Feb 25, 2013 at 11:48 AM, Favre Jean <jfavre at cscs.ch> wrote:
> Dear list
> I need to extract subsets of an unstructured grid, based on a cell-based
> material id (an integer).
> I use the following:
> and a vtkDoubleArray with two tuples, holding the same value as min and
> max, equal to my material id.
> this works fine and is quite fast. However, I thought it should be even
> faster, not having to threshold between a min and max values which, in this
> case, are equal, and to instead directly select by the integer value.
> So I changed the code to use a vtkIntArray with 1 tuple equal to the
> material id, and changed my selectionNode:
> this new version produces the correct and identical selection as the first
> version, but the execution times is 20 seconds vs. 0.16 seconds. This is a
> huge difference and I'd like to have some insight about it. Why should
> value-based selection be so much slower? This small test only has 80k
> cells. [My real data has 10+ million cells, :-( ]
> I took the example benchmark in
> and modified it to test, so I can share the updated benchmark.
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the VTK FAQ at:
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers