Click here to Skip to main content
15,894,460 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Memory Leak WIth OLE2A and other conversion macros. Pin
Tim Smith9-Jan-03 3:54
Tim Smith9-Jan-03 3:54 
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 
I'm sure this topic has been discussed to death, I know I've read a number of posts arguing both sides. But I would like some solid evidence supporting both arguments. So, what I've decided to do is write up some routines that will test the collections in both MFC and STL on the same ground. If anyone has knows of similar tests that are on the web or elsewhere, I would greatly appreciate the references.

The output of my tests are below and I would be happy to submit the code if desired. As I am just getting into learning STL (I purchased "The Standard C++ Library" by Nicolai M. Josuttis resently) I am only testing vector against CArray at the moment and only under add and remove of integer values.

There were 6 tests. I first tested vector<int> without reserving any space, then with reserving an equal number of elements as loops - both previous tests using .push_back() - and the third reserving and accessing each element with [].

The next 3 tests were with CArray<int, int>; first without using .SetSize() and using .Add(), the next using .SetSize() and .Add() and the final using .SetSize() and .SetAt().

All values added were the element number * rand()

Are my tests poorly devised? Thank you for any input you can offer.

John

These tests were done with VC6 SP5 on a 1ghz Celeron with 256 megs of RAM

Performing test with 1000000 loops
Added without reserve to Vector<int> in 1.36 seconds
Removed all Vector<int> elements in 0.14 seconds
Added with reserve and push_back to Vector<int> in0.922 seconds
Removed all Vector<int> elements in 0.141 seconds
Added with reserve and [] to Vector<int> in 0.203 seconds
Removed all Vector<int> elements in 0 seconds
Added without SetSize to CArray<int, int> in 252.828 seconds
Removed all CArray elements in 0.031 seconds
Added with SetSize and Add to CArray<int, int> in 768.796 seconds
Removed all CArray elements in 0.047 seconds
Added with SetSize and SetAt to CArray<int, int> in 0.156 seconds
Removed all CArray elements in 0.031 seconds

These tests were performed on a 800MHz Duron with 256 megs of RAM

Performing test with 1000000 loops
Added without reserve to Vector<int> in 1.852 seconds
Removed all Vector<int> elements in 0.181 seconds
Added with reserve and push_back to Vector<int> in1.272 seconds
Removed all Vector<int> elements in 0.18 seconds
Added with reserve and [] to Vector<int> in 0.29 seconds
Removed all Vector<int> elements in 0 seconds
Added without SetSize to CArray<int, int> in 317.226 seconds
Removed all CArray elements in 0.02 seconds
Added with SetSize and Add to CArray<int, int> in 927.173 seconds
Removed all CArray elements in 0.04 seconds
Added with SetSize and SetAt to CArray<int, int> in 0.2 seconds
Removed all CArray elements in 0.02 seconds

GeneralRe: STL vs. MFC - The test code Pin
lpvoid6-Jan-03 8:56
lpvoid6-Jan-03 8:56 
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 

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.