Speeding up Sarkoa maps loading times.
I am on the quest to make Sarkoa as performant as possible. To do that I need to ensure that maps and map features load as optimally as possible - when something loads the user should see it!
To measure this I came up with a simple, repeatable metric: how many milliseconds until you can tap a particular marker and read its description?
First, the results
I got the AI to run five cold, signed-out visits before and after the change on an emulated mobile phone (390 × 844, cache off, 90 ms latency, 1.6 MB/s down, 0.4 MB/s up). Median times are listed here:
| Observable event | Before | After |
|---|---|---|
| First visible marker | 8.477 s | 5.893 s |
| Central’s count visible | 8.561 s | 5.949 s |
Every single run succeeded on the first tap, and clicking once the marker showed up only took 42 to 56 milliseconds. In other words, virtually the entire wait was just waiting for that first marker to hit the screen. These fixes chopped 2.612 seconds off the median (the ten recorded visits). Even the slowest run on the new build (6.347 s) beat the fastest run on the old one (7.329 s).
How we did it
- Waiting for JS to boot before checking access. Sarkoa was set up so even public maps run a quick access check before fetching layer data. The browser waited until the viewer bundle finished downloading and booting before firing that check, but now it kicks off in parallel while the bundle is coming through.
- Sequential server reads. On the backend, independent database and config reads for the map were running sequentially instead of concurrently. Parallelizing them shaved off even more waiting time.