Skip to content

Instantly share code, notes, and snippets.

@nikclayton
Created May 4, 2026 13:02
Show Gist options
  • Select an option

  • Save nikclayton/05d9f5ec2d65614de6556a9a2f3a0adf to your computer and use it in GitHub Desktop.

Select an option

Save nikclayton/05d9f5ec2d65614de6556a9a2f3a0adf to your computer and use it in GitHub Desktop.
Pachli startup latency

16 seconds is excessive, and suggests a latency problem with your server.

I just timed a cold start with this mastodon.social account and it was less than 5 seconds.

Pachli has to make a number of requests to your server before it can start showing your timeline. Some of these can run in parallel, some it has to wait for before proceeding.

Looking at a cold start with an account on mastodon.social Pachli makes the following requests (I've added the time it took for the most recent one too):

  • /api/v1/accounts/verify_credentials, 1,405ms

This verifies your account is still active and ensures Pachli has the most up-to-date information (e.g., if you changed your name, avatar, emojis, things like that).

This should complete before any of the other requests can start (because if your authentication credentials are bad then all the following requests will fail).

Then it makes these requests, one after the other.

  • /.well-known/nodeinfo, 27ms
  • /nodeinfo/2.0, 34ms

These are used to figure out the software your server is running and its version. This is necessary because different software x version combinations support different features, and Pachli needs to know this as part of enabling/disabling some parts of the UI (e.g., does the server support quoting, or scheduling posts).

  • /api/v1/custom_emojis, 66ms
  • /api/v2/instance, 41ms
  • /api/v1/announcements, 1,861ms
  • /api/v2/filters, 175ms
  • /api/v1/lists, 104ms

These run in parallel, but all have to complete before the UI can be shown. For example, the left-navigation menu shows you the lists you have available, available announcements, and so on. Or the timeline, which needs to know if your server supports translation.

There's two competing UI goals that are in tension here. On the one hand you want the UI to be usable as quickly as possible. On the other hand you want to be able to warn the user if necessary data couldn't be loaded before they start doing tasks in the app.

  • /api/v1/accounts/.../following, 167ms

This call may or may not block startup. Pachli allows you to create filters for Notifications and Conversations based on whether or not you are following an account.

To do this open, "Account preferences > Notification filters" and set the "... you don't follow" option to something other than "Show" (there's also "Conversation filters" to do this for conversations/DMs).

Mastodon does not support this functionality natively. If you have enabled this feature then Pachli waits for this call to complete before proceeding, as it needs the information to filter your timelines.

If you have not enabled this feature then Pachli makes the call but does not wait for it to complete.

mastodon/mastodon#33066 is the feature request for Mastodon to fix this.

  • /api/v1/statuses/..., 189ms
  • /api/v1/timelines/home?min_id=..., 149ms
  • /api/v1/timelines/home?max_id=..., 524ms

These are the calls to load the home timeline at the user's reading position. They run in parallel.

Masodon doesn't have an API call that lets you say "Load a page of posts from a timeline that's guaranteed to contain post X" so Pachli has to make three calls.

The first is "Get post X". The others are "Get a page of posts immediately older than post X" and "Get a page of posts immediately newer than post X".

Putting that together, that's 1,405 + 27ms + 34ms + 1,861ms + 524ms = 3,851ms of network requests that are on the critical path to Pachli being able to show you content. And of course there's some additional latency as Pachli caches this information locally (until the next cold start), loads other data from the local cache, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment