tharsis.prof.profiler

Functionality needed to record profiling data.

Profiler keeps track of profiling events.

Zone is an RAII struct that records precise time at its construction and destruction.

Realtime:

Recording is very lightweight, without any complicated logic or heap allocations. This allows to use Tharsis-prof as a 'short-term profiler' that can record profiling data over the duration of a few frames and be detect bottlenecks in real time. Game code can then react, for example by disabling resource intensive nonessential features (e.g. particle systems).

Precision:

Tharsis.prof measures time in D 'hectonanoseconds', or tenths of a microsecond. This is precise enough to detect irregular overhead during frames but not to profile individual instructions in a linear algebra function. Such use cases are better covered by a Callgrind or a sampling profiler such as perf or CodeAnalyst. Also note that some platforms may not provide access to high-precision timers and the results may be even less precise. At least Linux, Windows and OSX should be alright, though.

Members

Classes

Profiler
class Profiler

Records profiling events into user-specified buffer.

Manifest constants

checkpointByteCount
enum checkpointByteCount;
Undocumented in source.
eventIDBits
enum eventIDBits;
Undocumented in source.
eventIDMask
enum eventIDMask;
Undocumented in source.
lastBit
enum lastBit;
Undocumented in source.
timeByteBits
enum timeByteBits;
Undocumented in source.
timeByteMask
enum timeByteMask;
Undocumented in source.

Static functions

decode7Bit
ubyte[] decode7Bit(ubyte[5] encoded, ubyte[] target)
Undocumented in source. Be warned that the author may not have intended to support it.
encode7Bit
ubyte[] encode7Bit(ubyte[4] data, ubyte[] target)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Zone
struct Zone

Zone of profiled code.

Meta