Logfile handling, timestamp and speed (1 Viewer)

Bosso

Portal Pro
December 16, 2004
50
0
Sweden / Stockholm
To be able to see how long timme things take to execute, and then easier see where improvements for better performance can be made I suggest we put in milliseconds in the timestamp for each row.

Code for this:
-------------------------------------------------------------------
(I'm not a registred dev, so if someone could copy this into latest CVS)
File: core/guilib/log.cs
Line 132
Method: static public void WriteFile(LogType type, string format, params object[] arg)

Change line from:
writer.Write(DateTime.Now.ToShortDateString()+ " "+DateTime.Now.ToLongTimeString()+ " ");

To:
writer.Write(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToString("hh:mm:ss.fff") + " ");


Resulting in logfile with timestamp with milliseconds.
-------------------------------------------------------------------


Using the latest CVS, with the blue2 skin I found that the CleanupThumbs()
writes a lot to the logfile, and this consumes about 300ms on a 3GHz P4.
This because of the little animation on top wich loads about 90 thumbs.
Just removing write to the logfile in the cleanup function will speed things up.

Code for this:
-----------------
File: Core/guilib/GUITextureManager.cs
Remove line 617
Log.Write("texturemanager:dispose:" + cached.Name + " total:" + _cache.Count + " mem left:" + GUIGraphicsContext.DX9Device.AvailableTextureMemory.ToString());


/Bosso
 

Smirnuff

Portal Pro
December 7, 2004
630
3
United Kingdom
I don't think adding this as a permanent feature has any benefit, it takes 30 seconds for someone interested in performance tuning to do themselves and for the rest of the time its just more clutter in an already dense log.

Removing your second code block however is something I agree would be good, not from any performance standpoint since it would save a miniscule amount of clock cycles but from a readability factor.

This because of the little animation on top wich loads about 90 thumbs.

Its the reloading of the graphics that take the time not the logging.
 

Bosso

Portal Pro
December 16, 2004
50
0
Sweden / Stockholm
Since the Cleanup blocks other events, I think 300ms (or longer on a slower machine) is a long time to not be able to receive events etc.
My problem resulted in continious doubleclicks with the remotecontrol, since MP don't get the messages from the IR-driver in time.

I agree. The logfile gets totally clogged. with texturemanager messages.
 

Users who are viewing this thread

Top Bottom