DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0023912

TDataStd_ExtStringArray::Value() returns a copy of TCollection_ExtendedString, but it might return a reference.

Open CASCADEOCCT:Application Frameworkclosed4 public notes

Search issues

Description

If a returned value of the method TDataStd_ExtStringArray::Value() is a reference to TCollection_ExtendedString object, it might make this OCAF attribute much faster.

Steps to reproduce

# A non-reegression test for the changes:
NewDoc D
SetExtStringArray D 0:1 0 1 5 "A" "B" "C" "D" "E"
GetExtStringArray D 0:1

Public activity

4 archived notes

Participants are labeled by their role within this record.

01Author
Dear Michael, could you revise my changes, please?
The changes: "Since now TDataStd_ExtStringArray::Value() returns a constant reference to the string value. Also, a draw-command GetExtStringArray is modified to manipulate with the string by a constant reference".
Aim of the fix is to speed-up the OCAF attribute (acces to the value).
02Author
I forgot to mention that the changes are in CR23912.
03Commenter 3
It seems it is OK.
04Commenter 1
Dear Commenter 2,

Branch CR23912(and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 0 (2 on master)
Windows: 0 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs caf bug23912 - OK

Testing on Linux:
Total MEMORY difference: 366431576 / 366120428
Total CPU difference: 44184.97000000153 / 43868.170000001046

Testing on Windows:
Total MEMORY difference: 420472212 / 421385180
Total CPU difference: 33218.234375 / 31668.40625

There are not serious differences in images found by testdiff.