Add simple profiling for token counting and rendering

This commit is contained in:
maver
2023-07-01 20:01:49 +02:00
parent ec43295936
commit 8abff3c24f

View File

@ -342,15 +342,23 @@ PromptManagerModule.prototype.render = function (afterTryGenerate = true) {
this.error = null;
if (true === afterTryGenerate) {
// Executed during dry-run for determining context composition
this.profileStart('filling context');
this.tryGenerate().then(() => {
this.profileEnd('filling context');
this.profileStart('render');
this.renderPromptManager();
this.renderPromptManagerListItems()
this.makeDraggable();
this.profileEnd('render');
});
} else {
// Executed during live communication
this.profileStart('render');
this.renderPromptManager();
this.renderPromptManagerListItems()
this.makeDraggable();
this.profileEnd('render');
}
}