View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022901 | Open CASCADE | OCCT:VIS | public | 2012-01-12 18:56 | 2014-11-11 12:58 |
Reporter | Assigned To | bugmaster | |||
Priority | high | Severity | major | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Target Version | 6.8.0 | Fixed in Version | 6.8.0 | ||
Summary | 0022901: Low performance of IVtkTools_DisplayModeFilter | ||||
Description | Highlighting detected sub-shapes or the whole shape takes too long even on middle-size BREP shapes (like standard Bottom.brep). The main reason is that vtkExtractSelection class used to extract VTK cells for sub-shapes of necessary types internally uses the quick sort algorithm that tends to become "square-n" slow on arrays containing a lot of identical values (see http://en.wikipedia.org/wiki/Quicksort#Formal_analysis). And this is exactly the case for the array of sub-shape types. The idea is to re-write IVtkTools_DisplayModeFilter filter without using vtkExtractSelection, simply checking sub-shape types for all input cells against the set of requested output sub-shape types. | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
After proposed correction, IVtkTools_DisplayModeFilter filter seems to work quite well. However, there is some other performance bottleneck that results in low performance of (un-)highlighting in shell and compound selection modes. It is not clear if IVtkTools_DisplayModeFilter has some relation to this problem or not, thus I suggest this issue remains assigned until this final performance problem is fixed. |
|
Replacement of NCollection_Set by NCollection_DataMap gives good results due to hash function usage when searching ids in collection in the cycle in IVtkTools_SubPolyDataFilter.RequestData(). Tests have been performed on "bottom.brep" shape in wireframe mode for preselection of a shell. Time for the cycle: Before fix: 2.37804 sec After fix: 0.0073996 sec Detailed test report: ================================================================ Before fix (NCollection_Set.contains() is used in the cycle in SubPolyDataFilter) onCursorMove { IVtkTools_ShapePicker::Pick: 0:1.22262 IVtkTools_ShapePicker::GetPickedActors: 0:0.0296513 { including IVtkTools_ShapePicker::GetPickedShapesIds: 0:7.32928e-006 } IVtkTools_ShapePicker::GetPickedSubShapesIds: 0:7.21507e-006 IVtkOCCImpl_Shape->GetSubIds(id): 0:0.00686373 } onCursorMove: total before rendering: 0:1.38402 + onCursorMove:Render { IVtkTools_SubPolyDataFilter (07D96880): RequestData: SUBSHAPE_IDS { including cycle: if (!myIdsSet.IsEmpty()) { for (vtkIdType i = 0; i < size; i++) { if (myIdsSet.Contains (aDataArray->GetValue(i))) { // Add a cell id to output if it's value is in the set. idList->InsertNextId(i); } } } IVtkTools_SubPolyDataFilter (07D96880): cycle: 0:2.37804 } IVtkTools_SubPolyDataFilter (07D96880): total RequestData: 0:2.44854 IVtkTools_DisplayModeFilter (07D5BC90): RequestData IVtkTools_DisplayModeFilter (07D5BC90): >IVtkTools_SubPolyDataFilter::RequestData: MESH_TYPES IVtkTools_DisplayModeFilter (07D5BC90): total: 0:0.0633536 (including cycle: 0:0.0362115) } onCursorMove:Render: 0:2.70357 Total onCursorMove when select shell: ~ 4 sec ========================================================================= After fix (NCollection_DataMap.IsBound() is used in the cycle in SubPolyDataFilter) onCursorMove { IVtkTools_ShapePicker::Pick: 0:1.00375 IVtkTools_ShapePicker::GetPickedActors: 0:0.0307559 { including IVtkTools_ShapePicker::GetPickedShapesIds: 0:7.3954e-006 } IVtkTools_ShapePicker::GetPickedSubShapesIds: 0:9.59088e-006 IVtkOCCImpl_Shape->GetSubIds(id): 0:0.00687927 } onCursorMove: total before rendering: 0:1.15084 + IVtkTools_SubPolyDataFilter (07D7D5C8): RequestData: SUBSHAPE_IDS { IVtkTools_SubPolyDataFilter (07D7D5C8): cycle: 0:0.0073996 } IVtkTools_SubPolyDataFilter (07D7D5C8): total RequestData: 0:0.0765959 IVtkTools_DisplayModeFilter (07D5BCA0): RequestData IVtkTools_DisplayModeFilter (07D5BCA0): >IVtkTools_SubPolyDataFilter::RequestData: MESH_TYPES IVtkTools_DisplayModeFilter (07D5BCA0): total: 0:0.0300265 (including cycle: 0:0.00480859) } onCursorMove:Render: 0:0.295352 Total onCursorMove when select shell: ~ 1.4 sec |
|
There is a possibility to use std::unordered_set instead of NCollection_DataMap. We would avoid extra parameters which are necessary in the case of working with DataMap. What is your opinion? |
|
Why hot use NCollection_Map class declared in NCollection_Map.hxx? |
|
Corrected by patch for 0022877 (see branch CR22877). |
|
The issue was created during development of VIS component for development needs only. The issue has been corrected and should be closed, no testing is required. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-01-12 18:56 |
|
New Issue | |
2012-01-12 18:56 |
|
Assigned To | => rkv |
2012-01-12 18:56 |
|
Status | new => assigned |
2012-01-12 19:02 |
|
Description Updated | |
2012-01-19 09:41 |
|
Note Added: 0019177 | |
2012-01-27 17:07 |
|
Note Added: 0019288 | |
2012-01-27 17:09 |
|
Note Edited: 0019288 | |
2012-01-27 18:49 |
|
Note Added: 0019295 | |
2012-01-27 18:49 |
|
Assigned To | rkv => san |
2012-01-27 18:49 |
|
Status | assigned => feedback |
2012-02-02 13:54 |
|
Note Added: 0019356 | |
2012-02-02 13:54 |
|
Status | feedback => assigned |
2012-08-21 14:42 |
|
Note Added: 0021298 | |
2012-08-21 14:42 |
|
Status | assigned => resolved |
2012-08-21 15:14 |
|
Note Added: 0021299 | |
2012-08-21 15:14 |
|
Assigned To | san => bugmaster |
2012-08-21 15:14 |
|
Status | resolved => reviewed |
2012-08-21 15:16 |
|
Note Edited: 0021298 | |
2014-09-18 09:50 |
|
Target Version | => 6.8.0 |
2014-09-18 09:58 |
|
Category | PRODUCTS:VIS => OCCT:VIS |
2014-09-18 10:39 | bugmaster | Project | Internal => Open CASCADE |
2014-09-22 11:58 | apn | Test case number | => Not needed |
2014-09-22 11:58 | apn | Assigned To | bugmaster => san |
2014-09-22 11:58 | apn | Status | reviewed => closed |
2014-09-22 11:58 | apn | Resolution | open => fixed |
2014-09-22 13:40 | apn | Assigned To | san => bugmaster |
2014-09-22 13:40 | apn | Status | closed => feedback |
2014-09-22 13:41 | apn | Status | feedback => tested |
2014-09-22 13:41 | apn | Status | tested => verified |
2014-09-22 13:41 | apn | Relationship added | related to 0024904 |
2014-11-11 12:45 |
|
Fixed in Version | => 6.8.0 |
2014-11-11 12:58 |
|
Status | verified => closed |