FS#1065 — patch: performance meter
Attached to Project— OpenTTD
Opened by Benedikt Brüggemeier (skidd13) - Sunday, 22 July 2007, 03:06PM
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 | |
![]() |
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
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
This task depends upon
This task blocks these from closing

performance_meter_#25.patch
This patch looks flawed... you have to keep on moving around in order for it to do anything.. any ideas?
Updated against trunk. Was a one liner.
svn rev: 10672
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
Ok here is another update of the patch.
And another one.
Reverted too much from 28->29 here is the fixed version.
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.
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.
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
Sry for the double post. Here is the fixed version.
And another update. This fixes the memory leaks (I hope that I didn't missed any) and a few display bugs.