TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_profiler.h File Reference
#include <stdint.h>
#include <span>
#include <gui_core/gui_base_types.h>
#include <gui_core/gui_hash.h>

Go to the source code of this file.

Classes

struct  tachyon::Diagnostics::ScopeLocation
 Per-call-site descriptor, static at each TACHYON_PROFILE_SCOPE site. More...
class  tachyon::Diagnostics::ScopedTimer
 Times its own lifetime as a scope; a disabled profiler costs one branch. More...
struct  tachyon::Diagnostics::ProfileSample
 One finalized node, depth-first. Durations are windowed averages (~4 updates/s). More...

Namespaces

namespace  tachyon
namespace  tachyon::Diagnostics

Macros

#define TACHYON_PROFILE_ENABLED   1
#define TACHYON_PROFILE_SCOPE(name)
#define TACHYON_PROFILE_SCOPE_WAIT(name)
#define TACHYON_PROFILE_SCOPE_REF(locationLValue)
#define TACHYON_PROFILE_FRAME_BEGIN(name)
#define TACHYON_PROFILE_FRAME_END()

Functions

ProfilerCollector & tachyon::Diagnostics::MainThreadCollector ()
bool tachyon::Diagnostics::IsProfilingEnabled ()
void tachyon::Diagnostics::SetProfilingEnabled (bool enabled)
void tachyon::Diagnostics::Reset (ProfilerCollector &collector)
 Discards all nodes and history; cached scope sites re-resolve.
void tachyon::Diagnostics::EnterScope (ProfilerCollector &collector, uint64_t nameHash, const char *name, bool isWait=false, const char *file="", int line=0) noexcept
 Uncached scope entry, for direct use and tests; pair with ExitScope.
std::span< const ProfileSample > tachyon::Diagnostics::LastFrameSamples (const ProfilerCollector &collector)
 The nodes of the last finalized frame, depth-first. Valid until the next EndFrame.
double tachyon::Diagnostics::LastFrameTotalMs (const ProfilerCollector &collector)
 Smoothed total of the root scope(s): the frame total, in milliseconds.
void tachyon::Diagnostics::BeginFrame (ProfilerCollector &collector)
 Frame boundaries: call once each, around all scopes for the frame.
void tachyon::Diagnostics::EndFrame (ProfilerCollector &collector)
 Frame boundaries: call once each, around all scopes for the frame.
void tachyon::Diagnostics::EnterScope (ProfilerCollector &collector, ScopeLocation &loc) noexcept
 Cached scope entry / exit, as the macros use.
void tachyon::Diagnostics::ExitScope (ProfilerCollector &collector) noexcept
 Cached scope entry / exit, as the macros use.

Macro Definition Documentation

◆ TACHYON_PROFILE_ENABLED

#define TACHYON_PROFILE_ENABLED   1

◆ TACHYON_PROFILE_SCOPE

#define TACHYON_PROFILE_SCOPE ( name)
Value:
((void)0)

◆ TACHYON_PROFILE_SCOPE_WAIT

#define TACHYON_PROFILE_SCOPE_WAIT ( name)
Value:
((void)0)

◆ TACHYON_PROFILE_SCOPE_REF

#define TACHYON_PROFILE_SCOPE_REF ( locationLValue)
Value:
((void)0)

◆ TACHYON_PROFILE_FRAME_BEGIN

#define TACHYON_PROFILE_FRAME_BEGIN ( name)
Value:
((void)0)

◆ TACHYON_PROFILE_FRAME_END

#define TACHYON_PROFILE_FRAME_END ( )
Value:
((void)0)