diff --git a/apps/ssb.json b/apps/ssb.json index 7a87ea7a..bb9aa5bf 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&HrNj+ya8UIHQIy0MgoaKBcW+MU56iKLqpNpOnUiKTZg=.sha256" + "previous": "&W1tVCm6k+sTaIprqugaZlifh/FPQWCqGXXHn1hojCHI=.sha256" } diff --git a/apps/ssb/app.js b/apps/ssb/app.js index 3373c85f..f299055e 100644 --- a/apps/ssb/app.js +++ b/apps/ssb/app.js @@ -79,11 +79,13 @@ tfrpc.register(async function query(sql, args, options) { } } let end = new Date(); - print( - (end - start) / 1000, - entry ? 'from cache' : 'from db', - sql.replaceAll(/\s+/g, ' ').trim() - ); + if (end - start > 1000) { + print( + (end - start) / 1000, + entry ? 'from cache' : 'from db', + sql.replaceAll(/\s+/g, ' ').trim() + ); + } return result; }); tfrpc.register(async function appendMessage(id, message) { diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 7312642d..89f2b7cf 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -435,7 +435,6 @@ class TfElement extends LitElement { } async load_channels_latest(following) { - let start_time = new Date(); let latest_private = this.get_latest_private(following); const k_args = [ JSON.stringify(this.channels), @@ -510,9 +509,7 @@ class TfElement extends LitElement { } } this.channels_latest = latest; - console.log('channels took', (new Date() - start_time) / 1000.0); let self = this; - start_time = new Date(); latest_private.then(async function (latest) { let grouped = await self.group_private_messages(latest[1]); self.channels_latest = Object.assign({}, self.channels_latest, { @@ -520,7 +517,6 @@ class TfElement extends LitElement { }); self.private_messages = latest[1]; self.grouped_private_messages = grouped; - console.log('private took', (new Date() - start_time) / 1000.0); }); } @@ -597,7 +593,6 @@ class TfElement extends LitElement { this.loading_latest = true; this.reset_progress(); try { - let start_time = new Date(); let whoami = this.whoami; let following = await tfrpc.rpc.following([whoami], 2); let old_users = this.users ?? {}; @@ -622,30 +617,13 @@ class TfElement extends LitElement { (await tfrpc.rpc.databaseGet('unread')) ?? '{}' ); this.following = Object.keys(following); - let about_start_time = new Date(); - start_time = new Date(); users = await this.fetch_user_info(users); - console.log( - 'user info took', - (new Date() - start_time) / 1000.0, - 'seconds' - ); this.users = users; let self = this; this.fetch_about(following, users).then(function (result) { self.users = result; - console.log( - 'about took', - (new Date() - about_start_time) / 1000.0, - 'seconds for', - Object.keys(users).length, - 'users' - ); }); - console.log( - `load finished ${whoami} => ${this.whoami} in ${(new Date() - start_time) / 1000}` - ); await reactions; this.whoami = whoami; this.loaded = whoami; diff --git a/apps/ssb/tf-news.js b/apps/ssb/tf-news.js index 7606df05..72ca8338 100644 --- a/apps/ssb/tf-news.js +++ b/apps/ssb/tf-news.js @@ -37,8 +37,6 @@ class TfNewsElement extends LitElement { let self = this; let messages_by_id = {}; - console.log('processing', messages.length, 'messages'); - function ensure_message(id, rowid) { let found = messages_by_id[id]; if (found) { diff --git a/apps/ssb/tf-tab-news-feed.js b/apps/ssb/tf-tab-news-feed.js index 531b87e2..38300de1 100644 --- a/apps/ssb/tf-tab-news-feed.js +++ b/apps/ssb/tf-tab-news-feed.js @@ -396,7 +396,6 @@ class TfTabNewsFeedElement extends LitElement { ) ) ); - console.log('done loading latest messages.'); } async load_messages() { @@ -434,9 +433,6 @@ class TfTabNewsFeedElement extends LitElement { this.messages = this.merge_messages(this.messages, messages); } this.time_loading = undefined; - console.log( - `loading ${messages.length} messages done for ${self.whoami} in ${(new Date() - start_time) / 1000}s` - ); } mark_all_read() {