From 8abff3c24fcedaafc478cdc799b2138cd58c42a3 Mon Sep 17 00:00:00 2001 From: maver Date: Sat, 1 Jul 2023 20:01:49 +0200 Subject: [PATCH] Add simple profiling for token counting and rendering --- public/scripts/PromptManager.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 938b89234..4ac65b2a6 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -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'); } }