add timer info

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-04-23 12:49:41 +02:00
parent 21b34a6fa7
commit 40e550f1c3
23 changed files with 194 additions and 76 deletions
+9 -2
View File
@@ -163,6 +163,7 @@ function setFontSize(val, old) {
appliedFontSize = nextSize;
const t1 = performance.now();
log('setFontSize', nextSize, `time=${Math.round(t1 - t0)}`);
timer('setFontSize', t1 - t0);
});
}
@@ -473,6 +474,7 @@ function registerTextareaCallback() {
// sortUIElements();
if (promptsInitialized) return;
if (promptRegistrationInProgress) return;
const t0 = performance.now();
const app = gradioApp();
if (!app) return;
@@ -540,7 +542,9 @@ function registerTextareaCallback() {
promptsInitialized = registeredPromptIds.size === total;
if (promptsInitialized) {
promptRegistrationInProgress = false;
log('initPrompts', registeredPromptIds.size);
const t1 = performance.now();
log('initPrompts', { count: registeredPromptIds.size, time: Math.round(t1 - t0) });
timer('initPrompts', t1 - t0);
return;
}
@@ -709,6 +713,7 @@ async function browseFolder() {
}
async function reconnectUI() {
const t0 = performance.now();
const gallery = gradioApp().getElementById('txt2img_gallery');
const task_id = localStorage.getItem('task');
const api_logo = Array.from(gradioApp().querySelectorAll('img')).filter((el) => el?.src?.endsWith('api-logo.svg'));
@@ -738,5 +743,7 @@ async function reconnectUI() {
};
const sd_model_observer = new MutationObserver(sd_model_callback);
sd_model_observer.observe(sd_model, { attributes: true, childList: true, subtree: true });
log('reconnectUI');
const t1 = performance.now();
log('reconnectUI', Math.round(t1 - t0));
timer('reconnectUI', t1 - t0);
}