add tracing for performance profiling
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "Tick.h"
|
||||
#include "tracing.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -396,6 +397,7 @@ void BeltSystem::clearTiles(const std::vector<QPoint>& tiles)
|
||||
|
||||
void BeltSystem::tick()
|
||||
{
|
||||
TRACE();
|
||||
advanceProgress();
|
||||
advanceTunnelProgress();
|
||||
moveItemsToNextTile();
|
||||
@@ -960,3 +962,4 @@ void BeltSystem::forEachVisualItem(QRect viewportTiles,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <set>
|
||||
|
||||
#include "SurfaceMask.h"
|
||||
#include "tracing.h"
|
||||
|
||||
BuildingSystem::BuildingSystem(const GameConfig& config,
|
||||
BeltSystem& belts,
|
||||
@@ -410,6 +411,7 @@ void BuildingSystem::setShipLayout(BuildingId id, const ShipLayoutConfig& layout
|
||||
|
||||
void BuildingSystem::tickConstruction(Tick currentTick)
|
||||
{
|
||||
TRACE();
|
||||
if (m_constructionQueue.empty())
|
||||
{
|
||||
return;
|
||||
@@ -516,6 +518,7 @@ void BuildingSystem::tickConstruction(Tick currentTick)
|
||||
|
||||
void BuildingSystem::tickBeltPull()
|
||||
{
|
||||
TRACE();
|
||||
for (Building& building : m_buildings)
|
||||
{
|
||||
// HQ: pull building_block items and add to global stock.
|
||||
@@ -591,6 +594,7 @@ void BuildingSystem::tickBeltPull()
|
||||
|
||||
void BuildingSystem::tickProduction(Tick currentTick)
|
||||
{
|
||||
TRACE();
|
||||
for (Building& building : m_buildings)
|
||||
{
|
||||
// Skip types without a recipe-based production loop.
|
||||
@@ -694,6 +698,7 @@ void BuildingSystem::tickProduction(Tick currentTick)
|
||||
|
||||
void BuildingSystem::tickShipyardProduction(Tick currentTick)
|
||||
{
|
||||
TRACE();
|
||||
for (Building& building : m_buildings)
|
||||
{
|
||||
if (building.type != BuildingType::Shipyard)
|
||||
@@ -795,6 +800,7 @@ void BuildingSystem::tickShipyardProduction(Tick currentTick)
|
||||
|
||||
void BuildingSystem::tickBeltPush()
|
||||
{
|
||||
TRACE();
|
||||
for (Building& building : m_buildings)
|
||||
{
|
||||
if (building.outputBuffer.items.empty())
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ShipSystem.h"
|
||||
#include "StationBodyComponent.h"
|
||||
#include "SurfaceMask.h"
|
||||
#include "tracing.h"
|
||||
#include "WaveSystem.h"
|
||||
#include "WeaponComponent.h"
|
||||
|
||||
@@ -198,6 +199,8 @@ void Simulation::tick()
|
||||
m_scrapSystem->tickDespawn(m_currentTick);
|
||||
|
||||
++m_currentTick;
|
||||
|
||||
PRINT_TRACES();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -361,6 +364,7 @@ void Simulation::placeEnemyStationSet(int generation)
|
||||
|
||||
void Simulation::tickDeathsAndLoot()
|
||||
{
|
||||
TRACE();
|
||||
// --- Dead ships ---
|
||||
std::vector<entt::entity> deadShips;
|
||||
m_admin.forEach<ShipIdentityComponent, HealthComponent>(
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "ShipSystem.h"
|
||||
#include "tracing.h"
|
||||
|
||||
WaveSystem::WaveSystem(const GameConfig& config, std::mt19937& rng)
|
||||
: m_config(config)
|
||||
@@ -15,6 +16,7 @@ WaveSystem::WaveSystem(const GameConfig& config, std::mt19937& rng)
|
||||
void WaveSystem::tickWaveScheduler(Tick currentTick, ShipSystem& ships,
|
||||
int worldHeightTiles)
|
||||
{
|
||||
TRACE();
|
||||
// 1. Advance boss countdown.
|
||||
--m_bossCountdownTicks;
|
||||
|
||||
@@ -75,6 +77,7 @@ void WaveSystem::tickWaveScheduler(Tick currentTick, ShipSystem& ships,
|
||||
|
||||
void WaveSystem::tickThreatAccumulation()
|
||||
{
|
||||
TRACE();
|
||||
const double x = static_cast<double>(m_bossWaveCounter);
|
||||
const double rate = m_config.world.waves.threatRateFormula.evaluate(x);
|
||||
if (rate > 0.0)
|
||||
|
||||
Reference in New Issue
Block a user