Instant Map

Instant Map / Speed

Fast, because the first view is a picture.

A map does not need a program to be seen. Instant Map sends the view as one cached image, and loads the interactive part only when someone reaches for it. The numbers below are measured on this page, on your connection.

This visit

Map of sample San Francisco rentals
Map image arrived
…
Counted from the start of this page load.
JavaScript needed to see it
0KB
The image is a plain <img> in the HTML.
Loader, after the image
7.5KB
Gzipped. Waits for a touch and does nothing else.
Engine, on first touch
11.4KB
Not loaded yet. Point at the map above.

Time a fresh load

The test loads a map from nothing, twice. The first is a view that is asked for often, so it is normally already cached. The second is a view nobody has asked for, so the server fetches the map data and draws it while you wait. Each clock stops when the image is on screen.

Press run

Times depend on your connection and on how close you are to a Cloudflare data centre. A second run of the first test may come straight from your browser's cache; the result says so when it does.

What is loaded, and when

WhenWhatSize, gzipped
With the HTMLOne map image0 KB of JavaScript
After the image showsLoader: the element, the camera and the wake-up logic7.5 KB
First point, touch or focusEngine: tiles, gestures, markers, clusters, keyboard, cards11.4 KB
While the map is moved256 px map tiles, only for the zoom level you stop onimages
When a card may openCard pictures for the markers nearest the centre, in idle timeimages

These sizes are read from the build that made this page. Every change to the project is checked against a size limit of 8 KB for the loader and 13 KB for the engine.

How it stays fast

Measure it yourself

Every rendered image says whether it came from cache and how long the map data took to fetch, so you can check the numbers in your own tools.

HTTP API reference
Full benchmark results and method

Timing

// In the browser: when did the first map image arrive?
const image = performance
  .getEntriesByType("resource")
  .find((entry) => entry.name.includes("/static?"));
console.log(Math.round(image.responseEnd), "ms");

// From a terminal: was it drawn now or served from cache?
// curl -sI "https://instantmap.org/static?center=-122.42,37.77&zoom=12" \
//   | grep -i -e cf-cache-status -e server-timing