Skip to content

Conversation

@dabreegster
Copy link
Collaborator

Turns can be generated from other data, so we can save space by not serializing them. Does it help?

  • huge_seattle, release mode, native
    • before: 258MB, 11.8s to load in UI (read the file, create DrawMap)
    • after: 218MB, 10.1s
  • central_seattle, debug mode, native
    • before: 54MB, 25.6s total
    • after: 43MB, 23.4s total
    • just deserializing the file drops from 8.4s to 6s
    • almost 1s spent reconstructing the turns

I'm now measuring on web. No parallelism there, so regenerating turns might be much slower.

Also need to silence the warnings when we generate turns; it's quite a spammy experience to just load a map.

@Robinlovelace
Copy link
Contributor

10% speed-up pretty impressive. Great work on diagnosing these areas where efficiency gains can be found!

@dabreegster
Copy link
Collaborator Author

Awww, this is a no-go for now. Creating turns serially on web is too slow.

  • central_seattle: 4.2s before, 5s after
  • huge_seattle: 12s before, 16.8s after

If there's an easy way to use web workers, we could try subbing it in

#[cfg(target_arch = "wasm32")]
. Looks like some crates require nightly rust: https://crates.io/crates/wasm-futures-executor, https://crates.io/crates/wasm-mt, https://crates.io/crates/wasm-bindgen-rayon. I think some of the approaches require browser support for modules in web workers or shared memory that isn't widely available: https://crates.io/crates/web_worker, https://crates.io/crates/wasm_thread. So... probably blocked.

@dabreegster dabreegster mentioned this pull request Nov 24, 2021
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

Successfully merging this pull request may close these issues.

4 participants