1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 18:25:16 +01:00

Implement profiler (#16194)

* Implement profiling API

* Add console commands for the profiler

* Remove accidental line

* Correct csv output

* Add copyright notice

* Add missing override

* Add default virtual destructor

* Explicitly pass template argument

* Use static

* Add plugin API for profiler

* Add more profile calls

* Workaround for GCC hopefully

* Add missing static keyword

* Use uint64 for call count

* Reduce name length see if CI passes

* Improve handling of function names

* Work around (broken) static inline variables

* Fix missing include

* Disable profiler for clang 5 and older

* Update copyright date

* Profile UpdateAllMiscEntities

* Apply review suggestions

Co-authored-by: Ted John <ted@brambles.org>
This commit is contained in:
ζeh Matt
2022-01-18 10:21:20 -08:00
committed by GitHub
parent e78704f48f
commit 993b168bfd
28 changed files with 678 additions and 8 deletions

View File

@@ -29,6 +29,7 @@
#include "../network/network.h"
#include "../object/ObjectManager.h"
#include "../object/TerrainSurfaceObject.h"
#include "../profiling/Profiling.h"
#include "../ride/RideConstruction.h"
#include "../ride/RideData.h"
#include "../ride/Track.h"
@@ -727,6 +728,8 @@ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection)
*/
void map_update_path_wide_flags()
{
PROFILED_FUNCTION();
if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
{
return;
@@ -1308,6 +1311,8 @@ TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants
*/
void map_update_tiles()
{
PROFILED_FUNCTION();
int32_t ignoreScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER;
if (gScreenFlags & ignoreScreenFlags)
return;
@@ -1349,6 +1354,8 @@ void map_update_tiles()
void map_remove_provisional_elements()
{
PROFILED_FUNCTION();
if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)
{
footpath_provisional_remove();
@@ -1370,6 +1377,8 @@ void map_remove_provisional_elements()
void map_restore_provisional_elements()
{
PROFILED_FUNCTION();
if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)
{
gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_1;