Hi Veli!

On 14/12/2009 14:41, Veli BOZATLI wrote:
>    [...]
>    if CanRead(100) then begin
>      recv := RecvBuffer(@fUDPBuf, 1325); // I log the time after this line

Where do you log it to?

I've been doing some speed tests recently and one thing I've found out 
is that logs to file affect performance noticeably when using several 
threads. Worse if protected using a critical section, but bad anyway... 
I suspect that calls to plain WriteLn are internally protected, and 
differently in different Windows versions.

The (partial) solution has been to keep a log that's private to each 
thread in a TStringList, later dumping to the general output, when 
thread dies. Still in need of some synchronization, but far better than 
using the critical section each time I want to leave some trace.

It might be better to avoid Write completely and log to a socket.

Depending on what the application does, it's also possible to avoid 
threads completely. I don't mean using events style, but simply 
processing data in the main thread loop as they come. I worked in a 
program that presented stock market data on screen. It *had* to be 
extremely fast. A solution that worked very well was to determine frames 
per second of screen presentation, slice it in half and give one half to 
receiving and processing, one half to painting.

Hope it helps!

-- 
saludos,

     Nico

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to