MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024832Community[OCCT] OCCT:Modeling Algorithmspublic2014-04-15 12:532014-11-11 12:52
ReporterTimo 
Assigned Toapn 
PrioritynormalSeveritytweak 
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version7 (64 bit)
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 6.8.0Fixed in Version[OCCT] 6.8.0 
Summary0024832: Performance of new boolean operations has become worse
DescriptionWhen upgrading from OCC 6.5.4 to 6.7.0 we noticed that the performance of boolean operations has become worse in several test cases (by factor 1.5 - 2.0).

Here a test case is added where we meassured the following times:
- OCC 6.5.4: 10 sec
- OCC 6.6.0: 11 sec
- OCC 6.7.0: 18 sec
- current master (10.04.20014): 18 sec

So, the performance mainly degraded from 6.6.0 to 6.7.0.

Is this expectable due to preparation of boolean operations for parallelization or should it be considered to be a bug?
Steps To Reproducerestore Comp3.brep c
explode c
bop c_1 c_2
TagsNo tags attached.
Test case numberNot needed
Attached Fileszip file icon Comp3.zip (476,487 bytes) 2014-04-15 12:53
zip file icon 0024832.zip (318,509 bytes) 2014-04-16 12:29
cxx file icon BOPTest_PartitionCommands.cxx (8,828 bytes) 2014-04-17 06:21

- Relationships
related to 0023807assignedemv Open CASCADE New Boolean operations have lower performance in some cases 
related to 0024979closedbugmaster Open CASCADE Optimize Extrema_GenExtCS 

-  Notes
(0028840)
ifv (developer)
2014-04-15 13:22

Dear PKV,
please check this issue
(0028869)
pkv (developer)
2014-04-16 12:28
edited on: 2014-04-17 06:24

The performance is getting worse in the class Extrema_ExtCS.
The class is intensively used in computations of Edge/Face Interferences.
The measurement of the performance has be done for the OCC6.6.0 and DEV.
The results are the following:
DEV
  full elapsed time: 19.30 sec
  time spent by Extrema_ExtCS: 9.73 sec

OCC6.6.0
  full elapsed time: 12.01 sec
  time spent by Extrema_ExtCS: 0.59 sec

For the case there are toltal 163 pairs of E/F to treat in terms of bounding
boxes.Thus the method IntTools_BeanFaceIntersector::Perform() is invoked at
least 163 times.
Inside the method there is a lot of Extrema_ExtCS::Perform(...).

The attachment contains 2 examples of E/F intersections where the performance
is worse in >3 times (0.24sec in DEV vs. 0.07sec. in OCC6.6.0)

#-------------------------------------------------------------
#Please, use the following commands to reproduce the problem:
# case 1
restore ez82 b1
restore fz2 b2

bclearobjects; bcleartools;
baddobjects b1 b2

bfillds -t -s

# case 2
restore ez89 b1
restore fz2 b2

bclearobjects; bcleartools;
baddobjects b1 b2

bfillds -t -s
#----------------------------------------------------------
Unfortunately in OCC6.6.0 there is not "-t -s" options,
but it is possible to provide them using the source:
DEV/BOPTest_PartitionCommands.cxx as a sample.
The modified file for OCC6.6.0 is in the attachment.

(0029083)
abv (manager)
2014-04-25 19:14

The performance has downgraded due to fix made for #23995: new calculations have been added for additional check of points of discontinuities on C0 curves.
(0029147)
dbp (developer)
2014-04-29 19:22

Dear kgv,

please review the patch in branch CR24832_1.
(0029148)
dbp (developer)
2014-04-29 19:30

Performance was slightly improved by implementing a few optimizations.

On attached test case the results are the following:
Master: 19.5 sec
Branch: 15.5 sec (- 20%)

The main question is about processing of "sharp points" (Extrema_ExtCS::Perform). Exluding first and last sharp points allows to improve performance by additional 40%:

  ...
  for (i = 2; i < SharpPoints.Upper(); i++)
  {
    ...

Therefore it may be incorrect because some solutions are produced by these points.
(0029149)
kgv (developer)
2014-04-30 08:41
edited on: 2014-04-30 08:50

Dear dbp,

+       pointer PToExtPExtS to ExtPExtS from Extrema;
+       pointer PToExtPRevS to ExtPRevS from Extrema;

please change definition of these classes to inherit from Standard_Transient and use as handles. They used only within Extrema package and no existed public API methods/classes will be affected by this change.

>> Therefore it may be incorrect because some solutions are produced by these points.
please apply this change as discussed with Andrey.

(0029156)
dbp (developer)
2014-04-30 11:30

Dear kgv,

please review the patch in branch CR24832_2.
(0029157)
dbp (developer)
2014-04-30 11:34

On attached test case the results are the following:
Master: 19.5 sec
Branch: 10.2 sec (-20% (optimizations) - 28% (sharp points) = -48%)
(0029159)
kgv (developer)
2014-04-30 12:01

The same issue is still here for two other fields:
+    myPExtS    : SurfacePtr        from Adaptor3d;
+    myPRevS    : SurfacePtr        from Adaptor3d;


Please consider changing their definition as NCollection_Handle (using imported) - in Extrema_ExtPExtS/Extrema_ExtPRevS and remove redundant fields from Extrema_ExtPS.
(0029280)
dbp (developer)
2014-05-12 16:01

Dear kgv,

please review modifications in branch CR24832_2.
(0029290)
kgv (developer)
2014-05-13 08:47

Please test the patch in branch CR24832_3.
(0029360)
apn (administrator)
2014-05-15 20:41

Dear BugMaster,

Branch CR24832_3 (and products from GIT master) was compiled on Linux, Windows and MacOS platforms and tested.
SHA-1: e6b0d9ec4736dc4c7665609f61f23fdc8a338703

Number of compiler warnings:

occt component :
Linux: 17 (17 on master)
Windows: 0 (0 on master)
MacOS: 205 (212 on master)

products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 355757448 / 355968116
Total CPU difference: 51924.55999999994 / 51289.87999999977

Testing on Windows:
Total MEMORY difference: 379613708 / 379904880
Total CPU difference: 42886.953125 / 35684.234375

There are no differences in images found by testdiff.
(0029361)
abv (manager)
2014-05-15 20:50

Andrey, please provide results of testing performance confirming that the original problem is fixed
(0029460)
apn (administrator)
2014-05-22 12:37

LINUX:
bug24823_1 (ez82 fz2)
master: Tps: 0.35
fix: Tps: 0.02

bug24823_2 (ez89 fz2)
master: Tps: 0.35
fix: Tps: 0.02

bug24823_3 (test in description)
master: Elapsed time: 21.889494 Seconds
fix: Elapsed time: 9.117681 Seconds

http://occt-tests/24832_branch_linux/summary.html [^]
http://occt-tests/24832_master_linux/summary.html [^]

WINDOWS:
bug24823_1 (ez82 fz2)
master: Tps: 0.42
fix: Tps: 0.03

bug24823_2 (ez89 fz2)
master: Tps: 0.43
fix: Tps: 0.03

bug24823_3 (test in description)
master: Elapsed time: 28.3160944599 Seconds
fix: Elapsed time: 10.0781670224 Seconds

http://occt-tests/24832_branch_windows/summary.html [^]
http://occt-tests/24832_master_windows/summary.html [^]

- Related Changesets
occt: master 0734c53d
Timestamp: 2014-05-22 13:52:20
Author: dbp
Committer: apn
Details ] Diff ]
0024832: Performance of new boolean operations has become worse

Replace C pointers with handles.
Encapsulate handles in Extrema_ExtPExtS and Extrema_ExtPRevS classes.
mod - src/Extrema/Extrema_ExtCS.cxx Diff ] File ]
mod - src/Extrema/Extrema_ExtPExtS.cdl Diff ] File ]
mod - src/Extrema/Extrema_ExtPExtS.cxx Diff ] File ]
mod - src/Extrema/Extrema_ExtPRevS.cdl Diff ] File ]
mod - src/Extrema/Extrema_ExtPRevS.cxx Diff ] File ]
mod - src/Extrema/Extrema_ExtPS.cdl Diff ] File ]
mod - src/Extrema/Extrema_ExtPS.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2014-04-15 12:53 Timo New Issue
2014-04-15 12:53 Timo Assigned To => ifv
2014-04-15 12:53 Timo File Added: Comp3.zip
2014-04-15 12:55 Timo Relationship added related to 0023807
2014-04-15 12:56 Timo Description Updated View Revisions
2014-04-15 12:59 Timo OS => Windows
2014-04-15 12:59 Timo OS Version => 7 (64 bit)
2014-04-15 13:22 ifv Note Added: 0028840
2014-04-15 13:22 ifv Assigned To ifv => pkv
2014-04-15 13:22 ifv Status new => assigned
2014-04-16 12:28 pkv Note Added: 0028869
2014-04-16 12:29 pkv File Added: 0024832.zip
2014-04-16 12:29 pkv Assigned To pkv => ifv
2014-04-17 06:21 pkv File Added: BOPTest_PartitionCommands.cxx
2014-04-17 06:24 pkv Note Edited: 0028869 View Revisions
2014-04-25 18:34 abv Relationship added child of 0023995
2014-04-25 19:09 abv Assigned To ifv => dbp
2014-04-25 19:14 abv Note Added: 0029083
2014-04-25 19:14 abv Target Version 6.7.1 => 6.8.0
2014-04-29 19:22 dbp Note Added: 0029147
2014-04-29 19:22 dbp Assigned To dbp => kgv
2014-04-29 19:22 dbp Status assigned => resolved
2014-04-29 19:30 dbp Note Added: 0029148
2014-04-30 08:41 kgv Note Added: 0029149
2014-04-30 08:41 kgv Assigned To kgv => dbp
2014-04-30 08:41 kgv Status resolved => assigned
2014-04-30 08:42 kgv Note Edited: 0029149 View Revisions
2014-04-30 08:50 kgv Note Edited: 0029149 View Revisions
2014-04-30 08:50 kgv Note Edited: 0029149 View Revisions
2014-04-30 11:30 dbp Note Added: 0029156
2014-04-30 11:30 dbp Assigned To dbp => kgv
2014-04-30 11:30 dbp Status assigned => resolved
2014-04-30 11:34 dbp Note Added: 0029157
2014-04-30 12:01 kgv Note Added: 0029159
2014-04-30 12:01 kgv Assigned To kgv => dbp
2014-04-30 12:01 kgv Status resolved => assigned
2014-05-12 16:01 dbp Note Added: 0029280
2014-05-12 16:01 dbp Assigned To dbp => kgv
2014-05-12 16:01 dbp Status assigned => resolved
2014-05-13 08:47 kgv Note Added: 0029290
2014-05-13 08:47 kgv Assigned To kgv => bugmaster
2014-05-13 08:47 kgv Status resolved => reviewed
2014-05-14 16:32 apn Assigned To bugmaster => apn
2014-05-15 20:41 apn Note Added: 0029360
2014-05-15 20:42 apn Test case number => Not needed
2014-05-15 20:42 apn Assigned To apn => bugmaster
2014-05-15 20:42 apn Status reviewed => tested
2014-05-15 20:50 abv Note Added: 0029361
2014-05-22 12:37 apn Note Added: 0029460
2014-05-23 14:25 apn Changeset attached => occt master 0734c53d
2014-05-23 14:25 apn Assigned To bugmaster => apn
2014-05-23 14:25 apn Status tested => verified
2014-05-23 14:25 apn Resolution open => fixed
2014-06-16 13:18 abv Relationship added related to 0024979
2014-11-11 12:46 user533 Fixed in Version => 6.8.0
2014-11-11 12:52 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker