View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0024042 | Community | OCCT:Foundation Classes | public | 2013-06-25 19:08 | 2013-12-19 13:56 |
Reporter | Roman Lygin | Assigned To | apn | ||
Priority | normal | Severity | integration request | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.6.0 | ||||
Target Version | 6.7.0 | Fixed in Version | 6.7.0 | ||
Summary | 0024042: Performance improvements: Foundation Classes | ||||
Description | A series of performance improvements, to help speed up surface-surface intersection. The set will be split into a few chunks to ease integration. Key details: * TCollection - more inlining In TCollection_Array1::Init() replaced with [i] - better for compiler's vectorization and consistent with Array2::Init() * NCollection_BaseCollection - added Allocator() to return an allocator. STL-consistent and allows to reuse allocator * Bnd_Box2d - Removed redundant copy (what becomes a hotspot) | ||||
Steps To Reproduce | N/A | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
related to | 0024072 | closed | Roman Lygin | Community | VC9 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx |
related to | 0024043 | closed | Roman Lygin | Community | Performance improvements: Modeling Algorithms |
related to | 0024044 | closed | bugmaster | Community | Performance improvements: Foundation Classes (math) |
related to | 0024071 | closed | Open CASCADE | VC 2009 64-bit compiler crashes while compiling IntPoly_ShapeSection.cxx |
|
The fix pushed into the repository |
|
One remark: the code or array constructors / destructors which is made inline contain conditional compilation triggered by macro __OPTIM_ARRAY. I believe it is potentially dangerous: even if this macro is not defined in OCCT, what if some application code defines it? I propose removing the code activated by this macro completely. Besides, if you have some numbers indicating how performance improved after this fix in your application, I encourage you to share these in a note to this issue -- it will help providing more sensible information of this fix in Release Notes. |
|
Thanks Andrey. The code under __OPTIM_ARRAY has been removed (the branch repushed into the repository). As for performance gains: I have been measuring cumulative effects of all changes done incrementally (in other related trackers - 0024043, 0024044). The CAD Exchanger code that invokes multiple intersection computations (which take about 80% of this code) speeds up by 20%-30% depending on workloads. That corresponds to ~25%-35% of the intersection code. Of course, the effect differs per workloads, as different code branches get executed but this gives an approximation. There are opportunities for greater speed up which would involve algorithm redesigns or other extensions (e.g. multiple computations of surface points at once instead of loop over poles). But this is currently beyond the scope of my effort. |
|
Reviewed, please test |
|
Dear BugMaster, Branch CR24042 (and products from GIT master) was compiled on Linux and Windows platforms and tested. SHA-1: db24b0959bce4a26d40b88b3e46d07f8495daa8e Number of compiler warnings: occt component : Linux: 2 (2 on master) Windows: 7 (7 on master) products component : Linux: 0 (0 on master) Windows: 63 (63 on master) Regressions: No regressions Improvements: No improvements Testing cases: Not needed Testing on Linux: Total MEMORY difference: 365028944 / 366290416 Total CPU difference: 44231.47000000074 / 43406.39000000102 Testing on Windows: Total MEMORY difference: 424202976 / 424097456 Total CPU difference: 40968.0625 / 44235.734375 There are not differences in images found by testdiff. |
|
This fix breaks compilation by MSVC++ 9.0 (MSVC 2008) in 64-bit mode, see http://dev.opencascade.org/index.php?q=node/781 |
|
Fix for 0024072 partially rolls back modifications made in TCollection to be more conservative. Note for the future: however, if some workloads demonstrate that inlining Array2 helps performance without inflating the code size then constructor/destructor can be inlined again. |
|
Reading figures above, it looks like performance is worse on Linux with this patch, isn't it? |
|
Denis, If you refer to the following excerpts: Testing on Linux: Total MEMORY difference: 365028944 / 366290416 Total CPU difference: 44231.47000000074 / 43406.39000000102 Testing on Windows: Total MEMORY difference: 424202976 / 424097456 Total CPU difference: 40968.0625 / 44235.734375 then they cannot be currently trusted for fine-/medium-grain performance differences as the testing is executed on virtual machines, per OCC guys. |
|
Yes Roman, this is what I had in mind. Thanks for your explanations. |
occt: master 1145e2bc 2013-07-04 10:31:57 Details Diff |
0024042: Performance improvements: Foundation Classes Removed code under former __OPTIM_ARRAY macro |
Affected Issues 0024042 |
|
mod - src/Bnd/Bnd_Box2d.cxx | Diff File | ||
mod - src/NCollection/NCollection_BaseCollection.hxx | Diff File | ||
mod - src/TCollection/TCollection_Array1.cdl | Diff File | ||
mod - src/TCollection/TCollection_Array1.gxx | Diff File | ||
mod - src/TCollection/TCollection_Array1.lxx | Diff File | ||
mod - src/TCollection/TCollection_Array2.cdl | Diff File | ||
mod - src/TCollection/TCollection_Array2.gxx | Diff File | ||
mod - src/TCollection/TCollection_Array2.lxx | Diff File | ||
mod - src/TCollection/TCollection_HArray1.cdl | Diff File | ||
mod - src/TCollection/TCollection_HArray1.gxx | Diff File | ||
mod - src/TCollection/TCollection_HArray1.lxx | Diff File | ||
mod - src/TCollection/TCollection_HArray2.cdl | Diff File | ||
mod - src/TCollection/TCollection_HArray2.gxx | Diff File | ||
mod - src/TCollection/TCollection_HArray2.lxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-06-25 19:08 | Roman Lygin | New Issue | |
2013-06-25 19:08 | Roman Lygin | Assigned To | => abv |
2013-06-25 19:13 | Roman Lygin | Note Added: 0024864 | |
2013-06-25 19:13 | Roman Lygin | Status | new => resolved |
2013-06-25 21:26 | Roman Lygin | Relationship added | related to 0024043 |
2013-06-25 22:00 | Roman Lygin | Relationship added | related to 0024044 |
2013-06-26 06:52 |
|
Note Added: 0024868 | |
2013-06-26 06:52 |
|
Assigned To | abv => Roman Lygin |
2013-06-26 06:52 |
|
Status | resolved => assigned |
2013-06-27 22:30 | Roman Lygin | Note Added: 0024906 | |
2013-06-27 22:31 | Roman Lygin | Assigned To | Roman Lygin => ifv |
2013-06-27 22:31 | Roman Lygin | Status | assigned => resolved |
2013-06-27 22:32 | Roman Lygin | Assigned To | ifv => abv |
2013-06-28 15:47 |
|
Note Added: 0024915 | |
2013-06-28 15:47 |
|
Assigned To | abv => bugmaster |
2013-06-28 15:47 |
|
Status | resolved => reviewed |
2013-07-01 15:42 |
|
Assigned To | bugmaster => mkv |
2013-07-03 11:42 |
|
Note Added: 0024951 | |
2013-07-03 11:42 |
|
Test case number | => Not needed |
2013-07-03 11:42 |
|
Assigned To | mkv => bugmaster |
2013-07-03 11:42 |
|
Status | reviewed => tested |
2013-07-03 11:44 | apn | Product Version | => 6.6.0 |
2013-07-03 11:44 | apn | Target Version | => 6.7.0 |
2013-07-05 11:57 | Roman Lygin | Changeset attached | => occt master 1145e2bc |
2013-07-05 11:57 | Roman Lygin | Assigned To | bugmaster => Roman Lygin |
2013-07-05 11:57 | Roman Lygin | Status | tested => verified |
2013-07-05 11:57 | Roman Lygin | Resolution | open => fixed |
2013-07-12 16:09 |
|
Note Added: 0025053 | |
2013-07-12 16:09 |
|
Assigned To | Roman Lygin => apn |
2013-07-12 16:22 | apn | Relationship added | related to 0024071 |
2013-07-12 16:36 | apn | Relationship added | related to 0024072 |
2013-07-16 21:50 | Roman Lygin | Note Added: 0025089 | |
2013-07-16 21:51 | Roman Lygin | Note Edited: 0025089 | |
2013-07-19 18:53 | barbier | Note Added: 0025125 | |
2013-07-19 20:13 | Roman Lygin | Note Added: 0025126 | |
2013-07-19 23:58 | barbier | Note Added: 0025127 | |
2013-12-19 13:52 | bugmaster | Status | verified => closed |
2013-12-19 13:56 | bugmaster | Fixed in Version | => 6.7.0 |