MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030165Open CASCADE[OCCT] OCCT:Foundation Classespublic2018-09-26 20:442018-10-02 15:43
Reporterkgv 
Assigned Toabv 
PrioritynormalSeverityfeature 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030165: Foundation Classes, TColStd_PackedMapOfInteger - provide flag for pre-allocating map of fixed size
DescriptionCurrently 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).
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0079422)
git (administrator)
2018-09-26 22:59

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.
(0079601)
abv (manager)
2018-10-02 15:18

Does it help in some known scenario?
(0079605)
kgv (developer)
2018-10-02 15:36

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
(0079606)
kgv (developer)
2018-10-02 15:43

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.

- Issue History
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-09-26 23:02 kgv Relationship added related to 0030161
2018-10-02 15:18 abv Note Added: 0079601
2018-10-02 15:36 kgv Note Added: 0079605
2018-10-02 15:43 kgv Note Added: 0079606


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker