Note: Currently this only works via Steam client
Usage:
Trace single function/method
@trace
function something() {
}
Trace whole class
@trace
class Something{
}
Trace code fragment
const t = (global as any).Tracing.startCall('something');
myCode();
t.endCall();
It works also with generators
@trace
function *generator() {
}
Trace engine code or js code
for(const m in Creep.prototype) {
wrapFunction(Creep.prototype, m, 'Creep');
}
JS codebases: copy those typescript files into: https://www.typescriptlang.org/play/index.html And use generated js equivalent
To start tracing type: trace(10)
where 10 is number of next ticks you want to trace.
After that you will get request to save trace.json
.
Next load that file in chrome dev tools on performance tab;