Click here to Skip to main content
15,919,423 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: how to include MFC in win32 Project? Pin
safee ullah3-Nov-02 18:05
safee ullah3-Nov-02 18:05 
AnswerRe: how to include MFC in win32 Project? Pin
Christian Graus3-Nov-02 18:46
protectorChristian Graus3-Nov-02 18:46 
GeneralRe: how to include MFC in win32 Project? Pin
Anonymous4-Nov-02 1:40
Anonymous4-Nov-02 1:40 
GeneralRe: how to include MFC in win32 Project? Pin
Christian Graus4-Nov-02 10:02
protectorChristian Graus4-Nov-02 10:02 
GeneralRe: how to include MFC in win32 Project? Pin
Giles5-Nov-02 3:29
Giles5-Nov-02 3:29 
AnswerRe: how to include MFC in win32 Project? Pin
Stephane Rodriguez.4-Nov-02 10:18
Stephane Rodriguez.4-Nov-02 10:18 
AnswerRe: how to include MFC in win32 Project? Pin
Giles5-Nov-02 3:32
Giles5-Nov-02 3:32 
Generalostringstream Pin
User 988530-Oct-02 13:27
User 988530-Oct-02 13:27 
I *was* using ostringstream as a member in a message construction class for a communication protocol. The app in question is a message format converter, that handles a few thousand messages per second on average and peaks can be in 10s of thousands per second.

The problem:

time_t t1, t2;
time(&t1);
for(unsigned long index = 0; index < 1000000; ++index)
{
    ostringstream s;
}
time(&t2);
printf("%d\n", t2-t1);

takes 5 seconds to complete, ie, 5microseconds just to init the ostringstream.
Is there something that I am doing wrong?

Now, I replaced the ostringstream with a char buffer[MAX_SIZE] and is using sprintf and lstrcat instead. The CPU utilization at peak reduced from around 50% to 12 - 13%.

The times of ostringstream drops to 1 second for the above loop, if I use the Singlethreaded library instead of multithreaded.

I do not have a specific question, but I would guess that one should use stringstream very carefully in a very performance critical part of a multithreaded program.

Thomas

modified 29-Aug-18 21:01pm.

GeneralRe: ostringstream Pin
Tim Smith30-Oct-02 13:59
Tim Smith30-Oct-02 13:59 
GeneralRe: ostringstream Pin
User 988530-Oct-02 15:41
User 988530-Oct-02 15:41 
GeneralRe: ostringstream Pin
Christian Graus30-Oct-02 14:06
protectorChristian Graus30-Oct-02 14:06 
GeneralRe: ostringstream Pin
Tim Smith30-Oct-02 14:41
Tim Smith30-Oct-02 14:41 
GeneralRe: ostringstream Pin
Christian Graus30-Oct-02 14:48
protectorChristian Graus30-Oct-02 14:48 
GeneralRe: ostringstream Pin
Tim Smith30-Oct-02 14:50
Tim Smith30-Oct-02 14:50 
GeneralRe: ostringstream Pin
Tim Smith30-Oct-02 14:51
Tim Smith30-Oct-02 14:51 
GeneralRe: ostringstream Pin
User 988530-Oct-02 16:07
User 988530-Oct-02 16:07 
GeneralUsing CTreeViewCtrl Pin
Jose Cruz30-Oct-02 3:08
Jose Cruz30-Oct-02 3:08 
GeneralRe: Using CTreeViewCtrl Pin
User 988530-Oct-02 13:32
User 988530-Oct-02 13:32 
GeneralRe: Using CTreeViewCtrl Pin
Jose Cruz1-Nov-02 4:31
Jose Cruz1-Nov-02 4:31 
Generalusing a activex dll created in vb in an atl/mfc component Pin
yeeeooowww29-Oct-02 1:31
yeeeooowww29-Oct-02 1:31 
GeneralRe: using a activex dll created in vb in an atl/mfc component Pin
ian mariano29-Oct-02 2:25
ian mariano29-Oct-02 2:25 
GeneralLoadRegTypeLib Question Pin
Anonymous28-Oct-02 12:58
Anonymous28-Oct-02 12:58 
GeneralRe: LoadRegTypeLib Question Pin
Anonymous29-Oct-02 0:23
Anonymous29-Oct-02 0:23 
Generalostream we all scream Pin
Todd Smith25-Oct-02 9:08
Todd Smith25-Oct-02 9:08 
GeneralRe: ostream we all scream Pin
Tim Smith25-Oct-02 9:46
Tim Smith25-Oct-02 9:46 

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.