mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026922: Huge performance issue writing data to the output stream
Test case for issue CR26922 Correction of literal (char to string)
This commit is contained in:
@@ -993,17 +993,17 @@ static void CompSparseArray (Draw_Interpretor& theDI,
|
||||
Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
|
||||
{
|
||||
if ( argc != 3) {
|
||||
di << "Usage : " << argv[0] << " Repeat Size" << "\n";
|
||||
di << "Usage : " << argv[0] << " Repeat Size\n";
|
||||
return 1;
|
||||
}
|
||||
Repeat = Draw::Atoi(argv[1]);
|
||||
Size = Draw::Atoi(argv[2]);
|
||||
if ( Repeat < 1 ) {
|
||||
di << "Repeat > 0" << "\n";
|
||||
di << "Repeat > 0\n";
|
||||
return 1;
|
||||
}
|
||||
if ( Size < 1 ) {
|
||||
di << "Size > 0" << "\n";
|
||||
di << "Size > 0\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@@ -951,7 +951,7 @@ void TestPerformanceRandomIterator(Draw_Interpretor& di)
|
||||
|
||||
// check that result is the same
|
||||
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
|
||||
di << "Error: sequences are not the same at the end!" << "\n";
|
||||
di << "Error: sequences are not the same at the end!\n";
|
||||
|
||||
delete aVector;
|
||||
delete aCollec;
|
||||
@@ -1003,7 +1003,7 @@ void TestPerformanceForwardIterator(Draw_Interpretor& di)
|
||||
|
||||
// check that result is the same
|
||||
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
|
||||
di << "Error: sequences are not the same at the end!" << "\n";
|
||||
di << "Error: sequences are not the same at the end!\n";
|
||||
|
||||
delete aVector;
|
||||
delete aCollec;
|
||||
@@ -1055,7 +1055,7 @@ void TestPerformanceBidirIterator(Draw_Interpretor& di)
|
||||
|
||||
// check that result is the same
|
||||
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
|
||||
di << "Error: sequences are not the same at the end!" << "\n";
|
||||
di << "Error: sequences are not the same at the end!\n";
|
||||
|
||||
delete aVector;
|
||||
delete aCollec;
|
||||
@@ -1140,33 +1140,33 @@ void TestPerformanceMapAccess(Draw_Interpretor& di)
|
||||
//=======================================================================
|
||||
static Standard_Integer QANTestNCollectionPerformance (Draw_Interpretor& di, Standard_Integer, const char**)
|
||||
{
|
||||
di << "Testing performance (Size | STL time | OCCT time | STL/OCCT boost)" << "\n";
|
||||
di << "Testing performance (Size | STL time | OCCT time | STL/OCCT boost)\n";
|
||||
|
||||
di << "\n" << "std::vector vs NCollection_Array1 (sort):" << "\n\n";
|
||||
di << "\nstd::vector vs NCollection_Array1 (sort):\n\n";
|
||||
TestPerformanceRandomIterator<NCollection_Array1<double>, std::vector<double> >(di);
|
||||
|
||||
di << "\n" << "std::vector vs NCollection_Vector (sort):" << "\n\n";
|
||||
di << "\nstd::vector vs NCollection_Vector (sort):\n\n";
|
||||
TestPerformanceRandomIterator<NCollection_Vector<double>, std::vector<double> >(di);
|
||||
|
||||
di << "\n" << "std::vector vs NCollection_Array1 (replace):" << "\n\n";
|
||||
di << "\nstd::vector vs NCollection_Array1 (replace):\n\n";
|
||||
TestPerformanceForwardIterator<NCollection_Array1<double>, std::vector<double> >(di);
|
||||
|
||||
di << "\n" << "std::vector vs NCollection_Vector (replace):" << "\n\n";
|
||||
di << "\nstd::vector vs NCollection_Vector (replace):\n\n";
|
||||
TestPerformanceForwardIterator<NCollection_Vector<double>, std::vector<double> >(di);
|
||||
|
||||
di << "\n" << "std::list vs NCollection_List (replace):" << "\n\n";
|
||||
di << "\nstd::list vs NCollection_List (replace):\n\n";
|
||||
TestPerformanceForwardIterator<NCollection_List<double>, std::list<double> >(di);
|
||||
|
||||
di << "\n" << "std::list vs NCollection_Sequence (replace):" << "\n\n";
|
||||
di << "\nstd::list vs NCollection_Sequence (replace):\n\n";
|
||||
TestPerformanceForwardIterator<NCollection_Sequence<double>, std::list<double> >(di);
|
||||
|
||||
di << "\n" << "std::list vs NCollection_Sequence (reverse):" << "\n\n";
|
||||
di << "\nstd::list vs NCollection_Sequence (reverse):\n\n";
|
||||
TestPerformanceBidirIterator<NCollection_Sequence<double>, std::list<double> >(di);
|
||||
|
||||
di << "\n" << "std::set vs NCollection_Map (search):" << "\n\n";
|
||||
di << "\nstd::set vs NCollection_Map (search):\n\n";
|
||||
TestPerformanceMapAccess<NCollection_Map<int>, int>(di);
|
||||
|
||||
di << "\n" << "std::set vs NCollection_IndexedMap (search):" << "\n\n";
|
||||
di << "\nstd::set vs NCollection_IndexedMap (search):\n\n";
|
||||
TestPerformanceMapAccess<NCollection_IndexedMap<int>, int>(di);
|
||||
|
||||
return 0;
|
||||
|
@@ -592,13 +592,13 @@ static void TestIndexedDataMap (QANCollection_IDMapFunc& theM)
|
||||
Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Lower, Standard_Integer& Upper)
|
||||
{
|
||||
if ( argc != 3) {
|
||||
di << "Usage : " << argv[0] << " Lower Upper" << "\n";
|
||||
di << "Usage : " << argv[0] << " Lower Upper\n";
|
||||
return 1;
|
||||
}
|
||||
Lower = Draw::Atoi(argv[1]);
|
||||
Upper = Draw::Atoi(argv[2]);
|
||||
if ( Lower > Upper ) {
|
||||
di << "Lower > Upper" << "\n";
|
||||
di << "Lower > Upper\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -611,7 +611,7 @@ Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& LowerRow, Standard_Integer& UpperRow, Standard_Integer& LowerCol, Standard_Integer& UpperCol)
|
||||
{
|
||||
if ( argc != 5) {
|
||||
di << "Usage : " << argv[0] << " LowerRow UpperRow LowerCol UpperCol" << "\n";
|
||||
di << "Usage : " << argv[0] << " LowerRow UpperRow LowerCol UpperCol\n";
|
||||
return 1;
|
||||
}
|
||||
LowerRow = Draw::Atoi(argv[1]);
|
||||
@@ -619,11 +619,11 @@ Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
LowerCol = Draw::Atoi(argv[3]);
|
||||
UpperCol = Draw::Atoi(argv[4]);
|
||||
if ( LowerRow > UpperRow ) {
|
||||
di << "LowerRow > UpperRow" << "\n";
|
||||
di << "LowerRow > UpperRow\n";
|
||||
return 1;
|
||||
}
|
||||
if ( LowerCol > UpperCol ) {
|
||||
di << "LowerCol UpperCol> " << "\n";
|
||||
di << "LowerCol UpperCol> \n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user