OpenTTD

Login!
Register as a new userLost password?

for Project:

FS#1065 — patch: performance meter

Attached to Project— OpenTTD
Opened by Benedikt Brüggemeier (skidd13) - Sunday, 22 July 2007, 03:06PM
Patch
Backend / Core
New
No-one
Linux
Medium
Normal
Devel (specify rev)
Undecided
Undecided
0%
A while ago Zojj wrote a patch to get a basic information how well his code improvements are. His patch worked only on Window$. At first I made a linux version of it. After a while Zojj assigned the patch to me. KUDr gave advice to me for the C++ conversion.

The patch can be used a FPS counter or as performance indicator.

There must be one thing checked: OS compatibility (at least Win32, Win64 and OSX)

forum topic: http://tt-forums.net/viewtopic.php?f=33&t=33121
svn rev: 10648
savegame bump: not needed  performance_meter_#25.patch
This task depends upon

This task blocks these from closing
Comment by Patric Stout (TrueLight) - Tuesday, 24 July 2007, 02:36PM

This patch looks flawed... you have to keep on moving around in order for it to do anything.. any ideas?


Comment by Benedikt Brüggemeier (skidd13) - Tuesday, 24 July 2007, 03:20PM

Updated against trunk. Was a one liner.

svn rev: 10672

  performance_meter_#26.patch
Comment by Benedikt Brüggemeier (skidd13) - Wednesday, 25 July 2007, 12:18PM

So here is the update.
Now it is possible to switch between real time and process time.
I splitted also the internal code from the GUI to extra files.

I wrote only the code for SDL based real time.

svn rev: 10684

  performance_meter_#27.patch   openttd.grf
Comment by Benedikt Brüggemeier (skidd13) - Wednesday, 25 July 2007, 11:00PM

Ok here is another update of the patch.

  performance_meter_#28.patch
Comment by Benedikt Brüggemeier (skidd13) - Thursday, 26 July 2007, 11:37AM

And another one.

  performance_meter_#29.patch
Comment by Benedikt Brüggemeier (skidd13) - Thursday, 26 July 2007, 11:56AM

Reverted too much from 28->29 here is the fixed version.

  performance_meter_#30.patch
Comment by Peter Nelson (peter1138) - Thursday, 26 July 2007, 12:03PM

What does 'TPS' stand for, anyway?

It also seems rather strange that what is essentially a performance debugging a tool (but not a very useful one) should require a GUI and quite a lot of code.


Comment by Benedikt Brüggemeier (skidd13) - Thursday, 26 July 2007, 12:20PM

TPS = Ticks Per Second
IMO the performance meter is for getting a basic impression of the current performance.
You could add a non GUI variant if you dislike the GUI.
The code has been written in such a way, because now other performance measurements could be added by using the same interface.
IIRC there are a few code parts in the source into this direction.


Comment by Benedikt Brüggemeier (skidd13) - Tuesday, 07 August 2007, 11:47PM

I extended the performance meter with a new type (CPU cycles per code calls).
It's nearly working as expected ;). The current value isn't drawn right. But I'd like to hear comments about the concept itself.
The idea how it should be used is in town_cmd.cpp

  performance_meter_r10814.patch
Comment by Benedikt Brüggemeier (skidd13) - Wednesday, 08 August 2007, 12:13AM

Sry for the double post. Here is the fixed version.

  performance_meter_r10822.patch
Comment by Benedikt Brüggemeier (skidd13) - Wednesday, 08 August 2007, 10:17PM

And another update. This fixes the memory leaks (I hope that I didn't missed any) and a few display bugs.

  performance_meter_r10827.patch