View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0030165 | Open CASCADE | OCCT:Foundation Classes | public | 2018-09-26 20:44 | 2021-09-03 13:40 |
| Reporter | kgv | Assigned To | bugmaster | ||
| Priority | normal | Severity | feature | ||
| Status | closed | Resolution | fixed | ||
| Target Version | 7.4.0 | ||||
| Summary | 0030165: Foundation Classes, TColStd_PackedMapOfInteger - provide flag for pre-allocating map of fixed size | ||||
| Description | Currently TColStd_PackedMapOfInteger behaves like a normal map - it dynamically resized the array of buckets and re-allocates each bucket after clearing the map. In some scenarios memory allocation might be a performance bottleneck, so that alternative approach might be considered - preserving map size with pessimistic scenario (number of buckets each to maximum integer key in the map, so that HashCode() would not truncate value). | ||||
| Tags | No tags attached. | ||||
| Test case number | |||||
|
|
Branch CR30165 has been created by kgv. SHA-1: 979f4e631ce1c8c8f7a3bfc057028dc284c98a76 Detailed log of new commits: Author: kgv Date: Wed Sep 26 22:11:59 2018 +0300 TColStd_PackedMapOfInteger::SparseAllocation() - added new flag managing memory allocation scheme between map style and array style. Author: kgv Date: Wed Sep 26 17:10:30 2018 +0300 0030165: Foundation Classes, TColStd_PackedMapOfInteger - provide flag for pre-allocating map of fixed size TCollection_BasicMap has been merged into TColStd_PackedMapOfInteger. TColStd_PackedMapOfInteger has been cleaned up from unsafe type casts. |
|
|
Does it help in some known scenario? |
|
|
This option gives only up to ~ 15% performance boost within my local tests. So that TColStd_BitField is expected to be better for extreme performance improvement, but this should be checked considering real bottlenecks in the whole process. On AIS_PointCloud: pload MODELING VISUALIZATION restore dem.brep d tcopy -mesh d d2 compound d d2 c trinfo c vclear vinit View1 vpointcloud p c vfit vzoom 0.5 chrono t reset; chrono t start vselmode p 1 1 chrono t stop; chrono t show chrono t reset; chrono t start vmoveto 250 250 chrono t stop; chrono t show vselect 0 0 chrono t reset; chrono t start vselect 10 10 400 400 chrono t stop; chrono t show vselect 0 0 chrono t reset; chrono t start vselect 100 100 250 250 chrono t stop; chrono t show Results for rectangular selection (includes time for highlighting selected points):
This shape contains 21807496 triangles.
10916172 nodes.
OLD map:
Elapsed time: 0 Hours 0 Minutes 0.934069483563 Seconds
NEW map:
Elapsed time: 0 Hours 0 Minutes 0.834714741781 Seconds
OLD map parallel:
Elapsed time: 0 Hours 0 Minutes 0.709464338026 Seconds
NEW map parallel:
Elapsed time: 0 Hours 0 Minutes 0.676648563385 Seconds
|
|
|
The code clean up of TColStd_PackedMapOfInteger also gives a tiny boost: 0.966598009458 s -> 0.934069483563 s of rectangular points selection with highlighting. In particular, current TColStd_PackedMapOfInteger implementation uses unneeded inheritance from Standard_Transient for map nodes. |
|
|
Please close the issue. |
|
|
Branch CR30165 has been deleted by inv. SHA-1: 979f4e631ce1c8c8f7a3bfc057028dc284c98a76 |
|
|
Branch CR30165 has been created by kgv. SHA-1: 979f4e631ce1c8c8f7a3bfc057028dc284c98a76 Detailed log of new commits: Author: kgv Date: Wed Sep 26 22:11:59 2018 +0300 TColStd_PackedMapOfInteger::SparseAllocation() - added new flag managing memory allocation scheme between map style and array style. Author: kgv Date: Wed Sep 26 17:10:30 2018 +0300 0030165: Foundation Classes, TColStd_PackedMapOfInteger - provide flag for pre-allocating map of fixed size TCollection_BasicMap has been merged into TColStd_PackedMapOfInteger. TColStd_PackedMapOfInteger has been cleaned up from unsafe type casts. |
|
|
|
|
|
|
|
|
Branch CR30165 has been deleted by kgv. SHA-1: 979f4e631ce1c8c8f7a3bfc057028dc284c98a76 |
|
|
Please close the bug. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2018-09-26 20:44 | kgv | New Issue | |
| 2018-09-26 20:44 | kgv | Assigned To | => abv |
| 2018-09-26 22:59 | git | Note Added: 0079422 | |
| 2018-10-02 15:18 |
|
Note Added: 0079601 | |
| 2018-10-02 15:36 | kgv | Note Added: 0079605 | |
| 2018-10-02 15:43 | kgv | Note Added: 0079606 | |
| 2019-03-02 23:35 | kgv | Note Added: 0082537 | |
| 2019-03-02 23:35 | kgv | Assigned To | abv => bugmaster |
| 2019-03-02 23:35 | kgv | Status | new => feedback |
| 2019-03-02 23:35 | kgv | Resolution | open => won't fix |
| 2019-03-05 10:12 | bugmaster | Status | feedback => closed |
| 2020-10-08 11:02 | git | Note Added: 0095820 | |
| 2020-11-16 22:16 | kgv | Relationship added | related to 0029642 |
| 2020-11-16 22:17 | git | Note Added: 0096802 | |
| 2020-11-16 22:30 | kgv | Relationship added | related to 0031943 |
| 2021-08-24 00:56 | kgv | Status | closed => feedback |
| 2021-08-24 00:56 | kgv | Resolution | won't fix => reopened |
| 2021-08-24 00:56 | kgv | File Added: 0001-0030165-Foundation-Classes-TColStd_PackedMapOfIntege.patch | |
| 2021-08-24 00:56 | kgv | File Added: 0002-TColStd_PackedMapOfInteger-SparseAllocation-added-ne.patch | |
| 2021-08-24 00:56 | git | Note Added: 0103394 | |
| 2021-08-24 00:57 | kgv | Note Added: 0103395 | |
| 2021-09-03 13:40 | bugmaster | Status | feedback => closed |
| 2021-09-03 13:40 | bugmaster | Resolution | reopened => fixed |