a-b-street/abstreet

Web client performance

Open

#377 geöffnet am 3. Nov. 2020

Auf GitHub ansehen
 (11 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (256 Forks)batch import
good first issue

Repository-Metriken

Stars
 (6.779 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Some different ideas for smoothing out the web client:

  • The .wasm binary is around 50MB, which makes initial startup time quite sad. Gzipped is around 20MB. I can't find any option to enable this in wasm-pack, because I think people generally just configure their web servers to do compression on-the-fly if the HTTP client sends Accept-Encoding headers. S3 doesn't support this, but I think it's possible to upload a .wasm.gz, point to it from the .html, and set the Content-Encoding header properly. Just need to test this and make sure browsers understand it.
  • Keep the Scenario for the current map in memory after loading it from a file. Otherwise, everytime the player resets to midnight in many gameplay modes, they have to download the file again!
  • In wasm_loader::FileLoader, display a progress bar with bytes downloaded / total length. I found set_onprogresss for XmlHttpRequest, but actually, we're currently using web_sys::Request, which is different. Can we switch?

Contributor Guide