View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023979 | Open CASCADE | OCCT:Data Exchange | public | 2013-05-21 16:57 | 2024-02-01 02:46 |
Reporter | Assigned To | dpasukhi | |||
Priority | normal | Severity | minor | ||
Status | assigned | Resolution | open | ||
Target Version | Unscheduled | ||||
Summary | 0023979: Data Exchange - Performance problem of STEP export for large files | ||||
Description | In order to reproduce the bug you can use attached scripts. Scripts t1, t3, t40, t60, t200 load from BRep file 1000, 3000... 200000 prisms, convert them to STEP format and save the result. Analyzing convertation with Intel VTune Amplifier I have not found significant hotspots (except hotspot described in the issue 23974). Also I have analyzed convertation with using CallCount. Comparing logs for 1000, 3000 and more shapes, does not detect unlinear dependencies. If you run script and open Windows Task Manager, you will see reducing of the memory. When the memory will be completely allocated, all open applications become unresponsive. Setting flag MMGT_OPT does not give visible improving of perfomance. | ||||
Steps To Reproduce | pload ALL autodisplay 0 compound c chrono h restart set n 200 set m 500 for {set i 0} {$i < $n} {incr i} { for {set j 0} {$j < $m} {incr j} { set xbase [expr $i*10] set ybase [expr $j*10] set size 5 vertex v1 $xbase $ybase 0 vertex v2 [expr $xbase+$size] $ybase 0 vertex v3 [expr $xbase+0.5*$size] [expr $ybase+0.866*$size] 0 edge e1 v1 v2 edge e2 v2 v3 edge e3 v3 v1 wire w e1 e2 e3 mkplane f w prism p f 0 0 10 add p c } } chrono h stop counter buildshape newmodel chrono h restart stepwrite 0 c 100K.step chrono h stop counter stepwrite meminfo | ||||
Tags | No tags attached. | ||||
Test case number | perf de bug23979 | ||||
2013-05-21 16:57 developer |
T1000.7z (78,797 bytes) |
2013-05-21 17:01 developer |
T3000.7z (276,987 bytes) |
2013-05-21 17:03 developer |
T40000.7z (3,507,025 bytes) |
2013-05-21 17:04 developer |
T60000.7z (4,643,853 bytes) |
|
In order to minimize secondary information of profiling with Intel VTune Amplifier, I reccomend to wrap the target function by methods __itt_resume() and __itt_pause(). Also it is important to specify settings of Amplifier project. Start new analysis -> Project properties -> Advanced For long-tme target is necessary increase "Duration time estimate" and "Collection data limit", otherwise result of profiling may be broken. |
|
Also I have use "Intel Advisor" to find out critical loops. In my opinion it would be useful to analyse possibility to make parallel loop in the STEPControl_ActorWrite::TransferCompound for ( i = 1; i <= nbs; i ++) { Handle(TransferBRep_ShapeMapper) subs = TransferBRep::ShapeMapper (FP,RepItemSeq->Value(i)); Handle(StepGeom_Axis2Placement3d) AX1; Handle(Transfer_Binder) bnd = TransferSubShape(subs, SDR0, AX1, FP, NonManifoldGroup, isManifold); if (!AX1.IsNull()) ItemSeq->Append (AX1); // copy binders so as to have all roots in upper binder, but do not conflict while ( !bnd.IsNull() ) { Handle(Transfer_SimpleBinderOfTransient) bx = Handle(Transfer_SimpleBinderOfTransient)::DownCast(bnd); if ( !bx.IsNull() ) // Single SDR is created for a non-manifold group (ssv: 12.11.2010) if (!isManifold && i > 1) break; else { Handle(Transfer_Binder) aResult = TransientResult( bx->Result() ); mapOfResultToAdd.Add( aResult ); } bnd = bnd->NextResult(); } } |
|
Reminder sent to: vro Dear vro, Could you attached snippet of code for generation BRep files which was used for convertation into STEP. Best regards, Sergey |
|
Private property, sorry. |
|
The test-model represents a set of identical shapes: prisms extruded from triangles. The triangles are the same and differ only by the location. It looks like a chess-field filled by the prisms in. The number of prisms varies up to 200 000. Probably a draw-script might generate the test-model, what do you think? |
|
compound_of_prisms.tcl that generates the compound of 200K prisms is attached. |
2013-05-22 19:58 developer |
compound_of_prisms.tcl (475 bytes) |
|
DRAW reproducer script is inefficient, it takes more than a whole day for it to complete. Thus a dedicated DRAW command should be created that builds the compound of prisms as illustrated by compound_of_prisms.tcl but fully with C++. |
|
Test case is required. |
|
QA command OCC23979 and test case bug23979 were attached to this issue. DRAW command build the compound of 200k prism, but it leads to out of memory (4GB RAM is not enough for execution of this command). |
2014-11-19 11:08 developer |
OCC23979.txt (1,740 bytes) |
2014-11-19 11:08 developer |
bug23979 (311 bytes) |
|
The script compound_of_prisms.tcl still can be used efficiently if we disable autodisplay feature in draw:autodisplay 0 Then this script takes 67 s to create the shape. |
|
With the patch for 0029830 writing to STEP of the shape got by this script takes 514 s. However the process ended with failure (malloc), and the result file has zero size. The error message is:Step File Name : 200K.step(55000020 ents) **** Interruption SendAll par Exception : **** Standard_MMgrRaw::Allocate(): malloc failed Abandon Error: File 200K.step written with fail messages During run, the application took about 28 Gb memory. |
|
With the model reduced down to 100K prisms it completed OK. The time is 265 s. The pick occupied memory is 15 Gb. The produced STEP file has the size 1.5 Gb. |
|
I have tried to perfom the same on current master. The process has taken 2 hours and it seems it did not reach yet even a half of the progress (it took only 2.6 Gb memory so far). Looking at its stack I have found that the hot spot is the method Transfer_Binder::AddResult(). This hot spot has been eliminated in the patch for 29830. |
|
So, the remaining problem is probably too much high memory eating. It is needed to investigate if this task can be done with less memory requirements. |
|
I have put the improved script in steps to reproduce. |
|
Branch CR23979_test has been created by abv. SHA-1: 3870430b9cb0d759c69066cd89a114f100d1f595 Detailed log of new commits: Author: abv Date: Wed Sep 4 18:28:49 2019 +0300 Test for 0023979: Performance problem of STEP export for large files |
|
Branch CR23979_test contains test script for the issue (with only 10000 prisms). On current master on my workstation it takes 30 sec overall, among which 13 sec are spent for conversion of the shape to STEP model (with peak VM size ~ 1 GB) and 7 sec for writing the file to disk (with VM peak 1.5 GB). The file size is 144 MB, thus timing seems to be reasonable, however memory consuption during writing model to file seems to be too big -- to be investigated. In OCCT 7.3.0, conversion to STEP took 373 sec on the same workstation, with other timings and VM usage the same as on master. Thus, we have essential improvement of performance of conversion to STEP on master (7.4.0) vs 7.3.0 (13 sec vs. 373 sec). |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-05-21 16:57 |
|
New Issue | |
2013-05-21 16:57 |
|
Assigned To | => gka |
2013-05-21 16:57 |
|
File Added: T1000.7z | |
2013-05-21 17:01 |
|
File Added: T3000.7z | |
2013-05-21 17:03 |
|
File Added: T40000.7z | |
2013-05-21 17:04 |
|
File Added: T60000.7z | |
2013-05-21 17:48 |
|
Note Added: 0024453 | |
2013-05-21 17:53 |
|
Relationship added | related to 0023974 |
2013-05-21 18:17 |
|
Note Added: 0024454 | |
2013-05-21 18:22 |
|
Note Added: 0024455 | |
2013-05-22 15:38 | vro | Note Added: 0024468 | |
2013-05-22 16:00 | vro | Note Added: 0024469 | |
2013-05-22 19:54 |
|
File Added: compound_of_prisms.tcl | |
2013-05-22 19:54 |
|
Note Added: 0024475 | |
2013-05-22 19:58 |
|
File Deleted: compound_of_prisms.tcl | |
2013-05-22 19:58 |
|
File Added: compound_of_prisms.tcl | |
2013-05-24 14:42 |
|
Note Added: 0024508 | |
2014-01-29 17:29 | bugmaster | Note Added: 0027696 | |
2014-01-29 17:29 | bugmaster | Assigned To | gka => apn |
2014-01-29 17:29 | bugmaster | Status | new => assigned |
2014-11-19 11:06 |
|
Note Added: 0034502 | |
2014-11-19 11:08 |
|
File Added: OCC23979.txt | |
2014-11-19 11:08 |
|
File Added: bug23979 | |
2014-11-19 11:08 |
|
Assigned To | apn => gka |
2014-11-19 11:26 |
|
Target Version | => 7.1.0 |
2016-10-26 12:18 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-27 09:33 |
|
Target Version | 7.2.0 => 7.4.0 |
2018-06-09 12:48 |
|
Assigned To | gka => msv |
2018-06-09 15:22 |
|
Note Added: 0076698 | |
2018-06-09 15:23 |
|
Note Edited: 0076698 | |
2018-06-09 16:05 |
|
Note Added: 0076700 | |
2018-06-09 16:06 |
|
Relationship added | related to 0029830 |
2018-06-09 16:17 |
|
Note Added: 0076702 | |
2018-06-09 18:13 |
|
Note Added: 0076709 | |
2018-06-09 18:17 |
|
Note Added: 0076710 | |
2018-06-09 18:18 |
|
Note Added: 0076711 | |
2018-06-09 18:18 |
|
Steps to Reproduce Updated | |
2018-06-09 18:19 |
|
Steps to Reproduce Updated | |
2018-06-09 18:19 |
|
Assigned To | msv => gka |
2019-09-04 18:09 | kgv | Summary | Performance problem of STEP export for large files => Data Exchange - Performance problem of STEP export for large files |
2019-09-04 18:31 | git | Note Added: 0086749 | |
2019-09-04 18:43 |
|
Note Added: 0086750 | |
2019-09-04 18:43 |
|
Target Version | 7.4.0 => 7.5.0 |
2019-09-04 19:01 |
|
Note Edited: 0086750 | |
2020-09-17 20:19 |
|
Target Version | 7.5.0 => 7.6.0 |
2020-09-18 22:24 |
|
Test case number | => perf de bug23979 |
2021-08-31 14:56 |
|
Target Version | 7.6.0 => Unscheduled |
2024-02-01 02:46 | dpasukhi | Assigned To | gka => dpasukhi |