|
-
December 1st, 2004, 12:05 PM
#46
Re: CString -vs- std:string ?
 Originally Posted by Axter
Well, then that's why we're getting different results, which is what I suspected.
I'm not sure what code of yours you're talking about, so please post what code you think is valid again, and if it is valid, I'll run it.
Why is it that you can't use the following code, which is a valid test with correct parameters:
I did, with VC 7.1:
Time duration is as follow:
CString = 2579
std::string = 2484
Press any key to continue . . .
-
December 1st, 2004, 12:36 PM
#47
Re: CString -vs- std:string ?
 Originally Posted by Axter
They're not running the last code I posted, which insures the results are release mdoe code.
So untill I see the results of that code, I can't really consider they're post.
Actually, I did run your code. The code that I compiled and posted the results of earlier was the test1.cpp file that Paul attached to message #28. It did have the release-mode check in place.
-
December 2nd, 2004, 05:13 AM
#48
Re: CString -vs- std:string ?
 Originally Posted by Axter
That looks like the results of running a debug version instead of a release compiled version.
Nope. It was definitely release version.
No third party libraries either.
std::string is always faster.
-
December 2nd, 2004, 05:28 AM
#49
Re: CString -vs- std:string ?
 Originally Posted by Axter
Try running the last code I posted, that has a debug compile directive, that makes sure you're getting results for release version.
Output from the new code
Time duration is as follow:
CString = 4036
std::string = 4627
Press any key to continue . . .
The original code shows std:string to be faster.
The new code shows CString to be faster.
Both sets of code compiled as Release versions.
-
December 2nd, 2004, 05:40 AM
#50
Re: CString -vs- std:string ?
If you disable exception handling in the project settings...
Time duration is as follow:
CString = 4246 <<<< Increase
std::string = 4376 <<<< Decrease
Press any key to continue . . .
-
June 21st, 2011, 03:26 PM
#51
Re: CString -vs- std:string ?
Looks like a very recent thread (only 7 years old, nothing compared to the cosmos)
Mckenzie and Axter, you guys were using systems with different system configuration. That is probably the explanation.
-
June 21st, 2011, 03:31 PM
#52
Re: CString -vs- std:string ?
I had tested it in several different systems, and they all gave similar results.
However, this thread is out dated, and more than likely does not hold true for the current std::string implementation that comes with current version of VC++.
-
June 22nd, 2011, 11:52 AM
#53
Re: CString -vs- std:string ?
 Originally Posted by Axter
However, this thread is out dated, and more than likely does not hold true for the current std::string implementation that comes with current version of VC++.
If you are still curious (I know I would be), here are the results from VS2010 (running on Win7-64, if that matters):
CString = 1623
std::string = 624
CString here is from ATL, not MFC.
I haven’t looked at the code close enough yet, but just wanted to say that if you know implementation details of each of these classes, you could come up with the test that favors any one of them. IIRC, both Intel and AMD used that technique in the past.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|