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

ATL / WTL / STL

 
QuestionDetect ATL control under IE8 Pin
chatko16-Jun-09 8:50
chatko16-Jun-09 8:50 
AnswerCross Posted Pin
led mike17-Jun-09 4:45
led mike17-Jun-09 4:45 
QuestionCrashes in ATL conversion macros Pin
Andrew Hain15-Jun-09 1:25
Andrew Hain15-Jun-09 1:25 
AnswerRe: Crashes in ATL conversion macros Pin
Stuart Dootson15-Jun-09 22:44
professionalStuart Dootson15-Jun-09 22:44 
QuestionTrouble running swf files from the internet in flash activeX Pin
GamerGoon11-Jun-09 19:59
GamerGoon11-Jun-09 19:59 
QuestionWhy STL string copy is 50% slower then memcpy_s? Pin
followait7-Jun-09 2:14
followait7-Jun-09 2:14 
AnswerRe: Why STL string copy is 50% slower then memcpy_s? Pin
«_Superman_»7-Jun-09 21:08
professional«_Superman_»7-Jun-09 21:08 
AnswerRe: Why STL string copy is 50% slower then memcpy_s? Pin
Stuart Dootson7-Jun-09 22:16
professionalStuart Dootson7-Jun-09 22:16 
followait wrote:
std::string knows the size of the string ahead, why it is much slower than memcpy_s (it can call memcpy_s in the implementation, right?),
In the debug version, the the difference of speed is about 15%, but in release version it is about 50%. Why?


If you trace through the disassembly, you find that std::string does call memcpy - it's just that it does a lot of other stuff - and looking at the disassembly of the C++ run-time library, MSVCP90, it doesn't inline aggressively, so there's a lot of calls incurred, which aren't too knd to performance...

BTW - what compiler options did you use? I used several sets - here are a couple of them (these trials used 10,000,000 iterations):

cl -MT -Ox -Ob2 -EHsc -Zi a.cpp


leads to

memcpy_s:       2000
string: 1078


cl -MD -Ox -Ob2 -EHsc -Zi a.cpp


leads to

memcpy_s:       610
string: 1062


So - just a runtime library change...go figure!

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Why STL string copy is 50% slower then memcpy_s? [modified] Pin
followait12-Jun-09 15:34
followait12-Jun-09 15:34 
GeneralRe: Why STL string copy is 50% slower then memcpy_s? Pin
Stuart Dootson13-Jun-09 12:55
professionalStuart Dootson13-Jun-09 12:55 
QuestionATL control tests freezes VS2005 Pin
progDes4-Jun-09 2:27
progDes4-Jun-09 2:27 
Questionerror LNK2001: unresolved external symbol _WndProcThunkProc Pin
sandhyaneel28-May-09 2:46
sandhyaneel28-May-09 2:46 
AnswerRe: error LNK2001: unresolved external symbol _WndProcThunkProc Pin
KarstenK28-May-09 3:42
mveKarstenK28-May-09 3:42 
Questionabout the class name of out stream or in stream Pin
followait27-May-09 17:21
followait27-May-09 17:21 
AnswerRe: about the class name of out stream or in stream Pin
Stuart Dootson27-May-09 22:42
professionalStuart Dootson27-May-09 22:42 
GeneralRe: about the class name of out stream or in stream Pin
followait28-May-09 2:10
followait28-May-09 2:10 
GeneralRe: about the class name of out stream or in stream Pin
Stuart Dootson28-May-09 2:16
professionalStuart Dootson28-May-09 2:16 
QuestionHow to combine several file streams to one memory binary stream? Pin
followait26-May-09 4:12
followait26-May-09 4:12 
AnswerRe: How to combine several file streams to one memory binary stream? Pin
Stuart Dootson26-May-09 13:05
professionalStuart Dootson26-May-09 13:05 
QuestionDraw Text Pin
komofilms7725-May-09 0:38
komofilms7725-May-09 0:38 
AnswerRe: Draw Text Pin
Stuart Dootson25-May-09 1:55
professionalStuart Dootson25-May-09 1:55 
QuestionHow to create machine certificate. Pin
deadlyabbas20-May-09 21:27
deadlyabbas20-May-09 21:27 
AnswerRe: How to create machine certificate. Pin
Randor 25-May-09 8:56
professional Randor 25-May-09 8:56 
QuestionAdd In project creation problem using ATL with VS2005 Pin
SNI12-May-09 21:07
SNI12-May-09 21:07 
AnswerRe: Add In project creation problem using ATL with VS2005 Pin
Stuart Dootson12-May-09 23:21
professionalStuart Dootson12-May-09 23:21 

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.