Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't load fast enough to use as a chat app #12

Open
fplord opened this issue Feb 20, 2023 · 8 comments
Open

doesn't load fast enough to use as a chat app #12

fplord opened this issue Feb 20, 2023 · 8 comments

Comments

@fplord
Copy link
Contributor

fplord commented Feb 20, 2023

every time you enter the page it has to fetch all the rooms which takes a few seconds. this is made worse by the fact that the game client iframe has to reload too, and blocks the main thread.

having 10+ seconds of friction every time someone wants to reply to a message is obviously unacceptable

not sure how exactly to solve this. webpages do lose their context a lot (do PWAs help here?) localStorage caching might help, but not sure how to unblock the main thread.

@billythedummy
Copy link
Contributor

billythedummy commented Feb 20, 2023

matrixClient.startClient() - 1.78s
image

It also seems like this function is being called multiple times, with all subsequent requests reaching the max timeout of 30s

Edit: nvm wrt last line this is because client architecture makes it call the sync endpoint in a loop

@billythedummy
Copy link
Contributor

Looked into https://github.com/matrix-org/matrix-spec-proposals/blob/kegan/sync-v3/proposals/3575-sync.md , seems new/experimental and wasn't just a plug and play - i think the user has to specify the pagination and how to control it and all that. Also, element client doesnt use it so gonna look at other places

@billythedummy
Copy link
Contributor

matrix-org/synapse#7781

@fplord
Copy link
Contributor Author

fplord commented Feb 20, 2023

matrixClient.startClient() - 1.78s
image

It also seems like this function is being called multiple times, with all subsequent requests reaching the max timeout of 30s

Edit: nvm wrt last line this is because client architecture makes it call the sync endpoint in a loop

1.78s round trip response doesn't seem too bad? as long as first paint is instant (cache chats + make sure loading game client doesn't block)

@fplord
Copy link
Contributor Author

fplord commented Feb 20, 2023

1.78s round trip response doesn't seem too bad? as long as first paint is instant (cache chats + make sure loading game client doesn't block)

could consider loading in the iframe with javascript only after the text chats are painted

@fplord
Copy link
Contributor Author

fplord commented Feb 21, 2023

did some experiments today with @billythedummy just now

  • (Android) iframe on firefox mobile is blocking, iframe on Chrome mobile is not blocking. With the iframe it takes about 6 seconds to load the messages, without it takes about 2 seconds
  • Without the Godot iframe, Hydrogen Web / PWA and our code take aroudn the same amount of time to load
  • Is the Godot game client running in debug mode? @f8122dac91

@f8122dac91
Copy link
Member

@fplord Yeah current CI pipeline setup is exporting debug build to vercel. PR for deploying release build: igneous-labs/telegram-space#47

@fplord
Copy link
Contributor Author

fplord commented Feb 26, 2023

it loads pretty quickly now on raw, quite a nice experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants