More benchmarks

This commit is contained in:
Lim Chee Aun 2024-09-09 16:36:42 +08:00
parent ec4916ab5c
commit 487e574765
3 changed files with 21 additions and 17 deletions

View file

@ -69,6 +69,7 @@ function Timeline({
const scrollableRef = useRef(); const scrollableRef = useRef();
console.debug('RENDER Timeline', id, refresh); console.debug('RENDER Timeline', id, refresh);
__BENCHMARK.start(`timeline-${id}-load`);
const mediaFirst = useMemo(() => isMediaFirstInstance(), []); const mediaFirst = useMemo(() => isMediaFirstInstance(), []);
@ -119,6 +120,7 @@ function Timeline({
setShowMore(false); setShowMore(false);
} }
setUIState('default'); setUIState('default');
__BENCHMARK.end(`timeline-${id}-load`);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
setUIState('error'); setUIState('error');

34
src/locales/en.po generated
View file

@ -54,7 +54,7 @@ msgstr ""
#: src/components/nav-menu.jsx:193 #: src/components/nav-menu.jsx:193
#: src/components/shortcuts-settings.jsx:137 #: src/components/shortcuts-settings.jsx:137
#: src/pages/following.jsx:20 #: src/pages/following.jsx:20
#: src/pages/following.jsx:131 #: src/pages/following.jsx:133
msgid "Following" msgid "Following"
msgstr "" msgstr ""
@ -527,7 +527,7 @@ msgstr ""
#: src/components/columns.jsx:19 #: src/components/columns.jsx:19
#: src/components/nav-menu.jsx:184 #: src/components/nav-menu.jsx:184
#: src/components/shortcuts-settings.jsx:137 #: src/components/shortcuts-settings.jsx:137
#: src/components/timeline.jsx:435 #: src/components/timeline.jsx:437
#: src/pages/catchup.jsx:876 #: src/pages/catchup.jsx:876
#: src/pages/filters.jsx:89 #: src/pages/filters.jsx:89
#: src/pages/followed-hashtags.jsx:40 #: src/pages/followed-hashtags.jsx:40
@ -606,7 +606,7 @@ msgstr ""
#: src/components/compose.jsx:1118 #: src/components/compose.jsx:1118
#: src/components/status.jsx:1962 #: src/components/status.jsx:1962
#: src/components/timeline.jsx:982 #: src/components/timeline.jsx:984
msgid "Content warning" msgid "Content warning"
msgstr "" msgstr ""
@ -856,13 +856,13 @@ msgstr ""
#: src/components/compose.jsx:3459 #: src/components/compose.jsx:3459
#: src/components/media-modal.jsx:387 #: src/components/media-modal.jsx:387
#: src/components/timeline.jsx:887 #: src/components/timeline.jsx:889
msgid "Previous" msgid "Previous"
msgstr "" msgstr ""
#: src/components/compose.jsx:3477 #: src/components/compose.jsx:3477
#: src/components/media-modal.jsx:406 #: src/components/media-modal.jsx:406
#: src/components/timeline.jsx:904 #: src/components/timeline.jsx:906
msgid "Next" msgid "Next"
msgstr "" msgstr ""
@ -959,7 +959,7 @@ msgid "Accounts"
msgstr "" msgstr ""
#: src/components/generic-accounts.jsx:205 #: src/components/generic-accounts.jsx:205
#: src/components/timeline.jsx:517 #: src/components/timeline.jsx:519
#: src/pages/list.jsx:293 #: src/pages/list.jsx:293
#: src/pages/notifications.jsx:820 #: src/pages/notifications.jsx:820
#: src/pages/search.jsx:454 #: src/pages/search.jsx:454
@ -968,7 +968,7 @@ msgid "Show more…"
msgstr "" msgstr ""
#: src/components/generic-accounts.jsx:210 #: src/components/generic-accounts.jsx:210
#: src/components/timeline.jsx:522 #: src/components/timeline.jsx:524
#: src/pages/search.jsx:459 #: src/pages/search.jsx:459
msgid "The end." msgid "The end."
msgstr "" msgstr ""
@ -1210,7 +1210,7 @@ msgstr ""
#: src/components/status.jsx:3413 #: src/components/status.jsx:3413
#: src/components/status.jsx:3509 #: src/components/status.jsx:3509
#: src/components/status.jsx:3587 #: src/components/status.jsx:3587
#: src/components/timeline.jsx:971 #: src/components/timeline.jsx:973
#: src/pages/catchup.jsx:75 #: src/pages/catchup.jsx:75
#: src/pages/catchup.jsx:1875 #: src/pages/catchup.jsx:1875
msgid "Filtered" msgid "Filtered"
@ -2291,12 +2291,12 @@ msgstr ""
msgid "<0/> <1/> boosted" msgid "<0/> <1/> boosted"
msgstr "" msgstr ""
#: src/components/timeline.jsx:451 #: src/components/timeline.jsx:453
#: src/pages/settings.jsx:1065 #: src/pages/settings.jsx:1065
msgid "New posts" msgid "New posts"
msgstr "" msgstr ""
#: src/components/timeline.jsx:552 #: src/components/timeline.jsx:554
#: src/pages/home.jsx:212 #: src/pages/home.jsx:212
#: src/pages/notifications.jsx:796 #: src/pages/notifications.jsx:796
#: src/pages/status.jsx:945 #: src/pages/status.jsx:945
@ -2304,21 +2304,21 @@ msgstr ""
msgid "Try again" msgid "Try again"
msgstr "" msgstr ""
#: src/components/timeline.jsx:586 #: src/components/timeline.jsx:588
msgid "{0, plural, one {# Boost} other {# Boosts}}" msgid "{0, plural, one {# Boost} other {# Boosts}}"
msgstr "{0, plural, one {# Boost} other {# Boosts}}" msgstr "{0, plural, one {# Boost} other {# Boosts}}"
#: src/components/timeline.jsx:591 #: src/components/timeline.jsx:593
msgid "Pinned posts" msgid "Pinned posts"
msgstr "Pinned posts" msgstr "Pinned posts"
#: src/components/timeline.jsx:944 #: src/components/timeline.jsx:946
#: src/components/timeline.jsx:951 #: src/components/timeline.jsx:953
#: src/pages/catchup.jsx:1892 #: src/pages/catchup.jsx:1892
msgid "Thread" msgid "Thread"
msgstr "" msgstr ""
#: src/components/timeline.jsx:966 #: src/components/timeline.jsx:968
msgid "<0>Filtered</0>: <1>{0}</1>" msgid "<0>Filtered</0>: <1>{0}</1>"
msgstr "" msgstr ""
@ -2889,11 +2889,11 @@ msgstr ""
msgid "No hashtags followed yet." msgid "No hashtags followed yet."
msgstr "" msgstr ""
#: src/pages/following.jsx:133 #: src/pages/following.jsx:135
msgid "Nothing to see here." msgid "Nothing to see here."
msgstr "" msgstr ""
#: src/pages/following.jsx:134 #: src/pages/following.jsx:136
#: src/pages/list.jsx:108 #: src/pages/list.jsx:108
msgid "Unable to load posts." msgid "Unable to load posts."
msgstr "" msgstr ""

View file

@ -28,6 +28,7 @@ function Following({ title, path, id, ...props }) {
async function fetchHome(firstLoad) { async function fetchHome(firstLoad) {
if (firstLoad || !homeIterator.current) { if (firstLoad || !homeIterator.current) {
__BENCHMARK.start('fetch-home-first');
homeIterator.current = masto.v1.timelines.home.list({ limit: LIMIT }); homeIterator.current = masto.v1.timelines.home.list({ limit: LIMIT });
} }
if (supportsPixelfed && homeIterator.current?.nextParams) { if (supportsPixelfed && homeIterator.current?.nextParams) {
@ -64,6 +65,7 @@ function Following({ title, path, id, ...props }) {
return bDate - aDate; return bDate - aDate;
}); });
} }
__BENCHMARK.end('fetch-home-first');
return { return {
...results, ...results,
value, value,