Click here to Skip to main content
15,916,189 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Memory Leak WIth OLE2A and other conversion macros. Pin
AlexO9-Jan-03 4:07
AlexO9-Jan-03 4:07 
GeneralRe: Memory Leak WIth OLE2A and other conversion macros. Pin
Tim Smith9-Jan-03 8:09
Tim Smith9-Jan-03 8:09 
GeneralRe: Memory Leak WIth OLE2A and other conversion macros. Pin
Michael Dunn8-Jan-03 11:05
sitebuilderMichael Dunn8-Jan-03 11:05 
Generalrun an .asp script from within my app Pin
LukeV6-Jan-03 9:19
LukeV6-Jan-03 9:19 
GeneralRe: run an .asp script from within my app Pin
AlexO7-Jan-03 2:53
AlexO7-Jan-03 2:53 
GeneralRe: run an .asp script from within my app Pin
Todd Smith11-Jan-03 4:41
Todd Smith11-Jan-03 4:41 
GeneralSTL vs. MFC Pin
lpvoid6-Jan-03 8:45
lpvoid6-Jan-03 8:45 
GeneralRe: STL vs. MFC - The test code Pin
lpvoid6-Jan-03 8:56
lpvoid6-Jan-03 8:56 
I decided to go ahead and include the test code so anyone can tell me if it is alright or not.

void main()
{
int iLoop = 1000000;
cout << "Performing test with " << iLoop << " loops\r\n";
vector<int> TestVector;
// TestVector.reserve(iLoop);
clock_t Start = clock();
for(int i = 0; i < iLoop; i++){
TestVector.push_back(i * rand());
}
clock_t Finish = clock();
double Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Added without reserve to Vector<int> in " << Time << " seconds\r\n";
Start = clock();
TestVector.clear();
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Removed all Vector<int> elements in " << Time << " seconds\r\n";
/////////////////////////////
TestVector.reserve(iLoop);
Start = clock();
for(i = 0; i < iLoop; i++){
TestVector.push_back(i * rand());
}
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Added with reserve and push_back to Vector<int> in" << Time << " seconds\r\n";
Start = clock();
TestVector.clear();
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Removed all Vector<int> elements in " << Time << " seconds\r\n";
/////////////////////////////
TestVector.reserve(iLoop);
Start = clock();
for(i = 0; i < iLoop; i++){
TestVector[i] = i * rand();
}
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Added with reserve and [] to Vector<int> in " << Time << " seconds\r\n";
Start = clock();
TestVector.clear();
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Removed all Vector<int> elements in " << Time << " seconds\r\n";

/////////////////////////////
CArray<int, int> TestCArray;
Start = clock();
for(int j = 0; j < iLoop; j++){
TestCArray.Add(j * rand());
}
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Added without SetSize to CArray<int, int> in " << Time << " seconds\r\n";
Start = clock();
TestCArray.RemoveAll();
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Removed all CArray elements in " << Time << " seconds\r\n";
/////////////////////////////
// TestCArray.SetSize(iLoop);
// Start = clock();
// for(j = 0; j < iLoop; j++){
// TestCArray.Add(j * rand()); //add's to the end after the .SetSize() elements are added
// }
// Finish = clock();
// Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
// cout << "Added with SetSize and Add to CArray<int, int> in " << Time << " seconds\r\n";
// Start = clock();
// TestCArray.RemoveAll();
// Finish = clock();
// Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
// cout << "Removed all CArray elements in " << Time << " seconds\r\n";
/////////////////////////////
TestCArray.SetSize(iLoop);
Start = clock();
for(j = 0; j < iLoop; j++){
TestCArray.SetAt(j, j * rand());
}
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Added with SetSize and SetAt to CArray<int, int> in " << Time << " seconds\r\n";
Start = clock();
TestCArray.RemoveAll();
Finish = clock();
Time = (double) (Finish - Start) / CLOCKS_PER_SEC;
cout << "Removed all CArray elements in " << Time << " seconds\r\n";

}
GeneralRe: STL vs. MFC Pin
Christian Graus6-Jan-03 9:19
protectorChristian Graus6-Jan-03 9:19 
GeneralRe: STL vs. MFC Pin
lpvoid6-Jan-03 9:36
lpvoid6-Jan-03 9:36 
GeneralRe: STL vs. MFC Pin
Christian Graus6-Jan-03 10:08
protectorChristian Graus6-Jan-03 10:08 
GeneralRe: STL vs. MFC Pin
Tim Smith6-Jan-03 10:12
Tim Smith6-Jan-03 10:12 
GeneralRe: STL vs. MFC Pin
lpvoid7-Jan-03 2:49
lpvoid7-Jan-03 2:49 
GeneralRe: STL vs. MFC Pin
Christian Graus7-Jan-03 9:37
protectorChristian Graus7-Jan-03 9:37 
GeneralRe: STL vs. MFC Pin
lpvoid8-Jan-03 1:54
lpvoid8-Jan-03 1:54 
GeneralRe: STL vs. MFC Pin
Tim Smith6-Jan-03 10:09
Tim Smith6-Jan-03 10:09 
GeneralRe: STL vs. MFC Pin
User 98858-Jan-03 9:47
User 98858-Jan-03 9:47 
GeneralRe: STL vs. MFC Pin
Christian Graus8-Jan-03 10:01
protectorChristian Graus8-Jan-03 10:01 
GeneralRe: STL vs. MFC Pin
User 98858-Jan-03 10:11
User 98858-Jan-03 10:11 
GeneralRe: STL vs. MFC Pin
lpvoid10-Jan-03 4:44
lpvoid10-Jan-03 4:44 
GeneralRe: STL vs. MFC Pin
Christian Graus10-Jan-03 9:33
protectorChristian Graus10-Jan-03 9:33 
GeneralRe: STL vs. MFC Pin
lpvoid10-Jan-03 13:05
lpvoid10-Jan-03 13:05 
GeneralRe: STL vs. MFC Pin
Tim Smith6-Jan-03 9:57
Tim Smith6-Jan-03 9:57 
GeneralRe: STL vs. MFC Pin
lpvoid7-Jan-03 2:52
lpvoid7-Jan-03 2:52 
GeneralRe: STL vs. MFC Pin
valikac6-Jan-03 16:10
valikac6-Jan-03 16:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.