]> OCCT Git - occt-copy.git/commitdiff
Test command for 22719: Performance problem of TCollection_ASciiString and OCCT memor... CR22719
authorabv <abv@opencascade.com>
Tue, 17 Jan 2017 06:33:45 +0000 (09:33 +0300)
committerabv <abv@opencascade.com>
Tue, 17 Jan 2017 06:33:45 +0000 (09:33 +0300)
src/QABugs/QABugs_20.cxx

index 2b88cf893e89164234276a0e1c0115124e438b6c..a785ab229e8ed63b4e02ce576e6c0be45102dd82 100644 (file)
@@ -56,6 +56,7 @@
 #include <XCAFDoc_ShapeTool.hxx>
 
 #include <HLRAppli_ReflectLines.hxx>
+#include <OSD_Chronometer.hxx>
 
 //=======================================================================
 //function : SurfaceGenOCC26675_1 
@@ -2182,6 +2183,27 @@ static Standard_Integer OCC28217(Draw_Interpretor& theDI,
   return 0;
 }
 
+static Standard_Integer OCC22719 (Draw_Interpretor& theDI, Standard_Integer theNArg, const char ** theArgVal)
+{
+  OSD_Chronometer aTimer;
+  aTimer.Start();
+
+  Standard_Integer n = 10000;
+  if (theNArg > 1)
+    n = Draw::Atoi (theArgVal[1]);
+
+  TCollection_AsciiString aString;
+  for (int i = 0; i < n; i++) {
+    aString += "Tested value";
+  } 
+
+  aTimer.Stop();
+  Standard_Real aCpu;
+  aTimer.Show (aCpu);
+
+  theDI << "COUNTER OCC22719 TCollection_AsciiString iterative grow, " << n << " times : " << aCpu;
+  return 0;
+}
 
 void QABugs::Commands_20(Draw_Interpretor& theCommands) {
   const char *group = "QABugs";
@@ -2202,7 +2224,8 @@ void QABugs::Commands_20(Draw_Interpretor& theCommands) {
   theCommands.Add("OCC26270", "OCC26270 shape result", __FILE__, OCC26270, group);
   theCommands.Add ("OCC27552", "OCC27552", __FILE__, OCC27552, group); 
   theCommands.Add("OCC27875", "OCC27875 curve", __FILE__, OCC27875, group);
-  theCommands.Add("OCC28217", "OCC28217", __FILE__, OCC28217, group);
+  theCommands.Add("OCC28217", "OCC28217: test concurrent raising of exceptions", __FILE__, OCC28217, group);
+  theCommands.Add("OCC22719", "OCC22719 [n=100000]: test multiple concatenation of a string", __FILE__, OCC22719, group);
 
   return;
 }