Archived issue #0031137
Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
Description
BinTools_ShapeSet allocates temporary arrays while reading triangulation and polygonal data, which looks redundant, although might be not critical from performance point of view.
Steps to reproduce
N/A
Public activity
16 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Nov 6 19:26:24 2019 +0300
0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
BinTools_ShapeSet now avoids allocation of temporary arrays while reading
triangulation and polygonal data.
Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
have been cleared from .lxx files and extended by new methods for preallocating and filling array,
as alternative to passing arrays by copy.
wavefront command - export "f" instead of obsolete "fo" keys into file.
BinTools - added missing tools for reading/writing short reals.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Nov 6 19:26:24 2019 +0300
0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
BinTools_ShapeSet now avoids allocation of temporary arrays while reading
triangulation and polygonal data.
Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
have been cleared from .lxx files and extended by new methods for preallocating and filling array,
as alternative to passing arrays by copy.
wavefront command - export "f" instead of obsolete "fo" keys into file.
BinTools - added missing tools for reading/writing short reals.
Patch is ready for review.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31137-master-KGV
The CPU time of XOpen is reduced up-to 9% on manually checked XBF files.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31137-master-KGV
The CPU time of XOpen is reduced up-to 9% on manually checked XBF files.
Poly_PolygonOnTriangulation has new method:
Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& theParameters);
Why not to use the notion like in the method ChangeNodes(), and as it is in Poly_Polygon3D.hxx:
TColStd_Array1OfReal& ChangeParameters() const { return myParameters->ChangeArray1(); }
I think it is needed to have the same convention on methods in the same family of classes.
Also, it is better to have the new constructor of Poly_PolygonOnTriangulation accepting the bool flag theHasParams.
Poly_Polygon2D does not have ctor for preallocating array, as alternative to passing array by copy.
The new ctors in above classes (if they have two parameters) do not need to be declared explicit.
BinTools_ShapeSet does not define the map with proper type instead of Standard_Transient for myPolygons2D.
Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& theParameters);
Why not to use the notion like in the method ChangeNodes(), and as it is in Poly_Polygon3D.hxx:
TColStd_Array1OfReal& ChangeParameters() const { return myParameters->ChangeArray1(); }
I think it is needed to have the same convention on methods in the same family of classes.
Also, it is better to have the new constructor of Poly_PolygonOnTriangulation accepting the bool flag theHasParams.
Poly_Polygon2D does not have ctor for preallocating array, as alternative to passing array by copy.
The new ctors in above classes (if they have two parameters) do not need to be declared explicit.
BinTools_ShapeSet does not define the map with proper type instead of Standard_Transient for myPolygons2D.
> BinTools_ShapeSet does not define the map with proper type instead of Standard_Transient for myPolygons2D.
In fact, class fills in myPolygons2D but doesn't use it in any way.
This is why I have decided not to change this map definition.
In fact, class fills in myPolygons2D but doesn't use it in any way.
This is why I have decided not to change this map definition.
> Why not to use the notion like in the method ChangeNodes(), and as it is in Poly_Polygon3D.hxx:
I can add Boolean flag for consistency, but SetParameters() will be still needed.
This is because BinTools_ShapeSet writing hasParameters flag in unfortunate place, unlike other collections.
I can add Boolean flag for consistency, but SetParameters() will be still needed.
This is because BinTools_ShapeSet writing hasParameters flag in unfortunate place, unlike other collections.
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Nov 8 12:41:12 2019 +0300
# remarks
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Nov 8 12:41:12 2019 +0300
# remarks
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Remarks have been pushed to branch.
The new ctor of Poly_Polygon2D is better to declare explicit.
Branch [archived branch] has been updated by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Nov 8 14:55:53 2019 +0300
# remarks 2
[revision removed]
Detailed log of new commits:
Author: Author
Date: Fri Nov 8 14:55:53 2019 +0300
# remarks 2
> The new ctor of Poly_Polygon2D is better to declare explicit.
Fixed.
Fixed.
Reviewed.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Nov 6 19:26:24 2019 +0300
0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
BinTools_ShapeSet now avoids allocation of temporary arrays while reading
triangulation and polygonal data.
Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
have been cleared from .lxx files and extended by new methods for preallocating and filling array,
as alternative to passing arrays by copy.
wavefront command - export "f" instead of obsolete "fo" keys into file.
BinTools - added missing tools for reading/writing short reals.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Wed Nov 6 19:26:24 2019 +0300
0031137: Modeling Data, BinTools_ShapeSet - avoid allocation of temporary arrays
BinTools_ShapeSet now defines maps with proper types instead of Standard_Transient.
BinTools_ShapeSet now avoids allocation of temporary arrays while reading
triangulation and polygonal data.
Classes Poly_Triangle, Poly_PolygonOnTriangulation, Poly_Polygon3D and Poly_Polygon2D
have been cleared from .lxx files and extended by new methods for preallocating and filling array,
as alternative to passing arrays by copy.
wavefront command - export "f" instead of obsolete "fo" keys into file.
BinTools - added missing tools for reading/writing short reals.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records