hi all!
i´ve written a programm to swap sum files from a tcp/ip connection. now i
havte to optimize the performance. but first i want to do some load tests.
how can i log the process informations like the task manager? i want to
see the tcp/ip connection, the processor efficiency. i dont want to
profile functions.
how can i do that?
thanks
best regards
shuo yang
You will need to consult your operating system's APIs to gather system
specific information such as that.
The Microsoft Task Manager doesn't usually give you much infomation
that would be useful in a first order analysis, especially without a
much deeper context of what was running on the machine.
I'd start by minimizing the test-to-test differences, such as what
the operating system and other tasks might be doing. Then construct
a large test and time it. time() is standard under C/C++. CTime()
can get much better resolution under Windows. Count the data or
transactions or whatever you want to measure and then do the math
and spit it out after the test.
Optimizing the underlying efficiency of TCP/IP and other APIs
that you depend on should be quite easy to guess. If it isn't part
of your code it probably takes a long time, relatively speaking.
So reading a TCP Stream byte by byte would likely be inefficient
because the many calls required to get a given unit of data would
be much larger than just asking for the unit of data. TCP doesn't
gaurantee large transfers to there is a bit of work to optimize
the solution. Generally if your application has nothing useful to
do, go to sleep and let the rest of the machine do what it wants.
As for optimizing after the fact, this could be easy or difficult
depending on how you wrote the initial application to start with.
Good luck,
David