Skip to content

Instantly share code, notes, and snippets.

View dgaubert's full-sized avatar

Daniel G. Aubert dgaubert

View GitHub Profile
@dgaubert
dgaubert / README.md
Created November 11, 2015 15:54 — forked from rochoa/README.md
CartoDB's MVT service + Mapbox GL

CartoDB's MVT service + Mapbox GL

Check index.html for some examples. These use a beta feature of CartoDB's Maps API: fixed URLs. So there is no need to use cartodb.js and tiles can be consumed using a named map name.

cartodb.js example

Check cartodb.js.html to see the integration with cartodb.js and in particular with cartodb.core.js.

Mapbox GL resources

@dgaubert
dgaubert / benchmark.md
Last active May 7, 2016 22:54
benchmark.mg

Benchmark

wrk -d10s -t2 http://localhost:3000/

express

  1. Requests/sec: 7783.32
  2. Requests/sec: 8783.42
  3. Requests/sec: 8592.44
  4. Requests/sec: 8713.99

Points

Node v0.10.26 / Mapnik 2.3.x / points / populated places / default style

wrk http://cdb.localhost.lan:8181/ --latency -s scripts/simple_map.lua -d 30 -t 4
Running 30s test @ http://cdb.localhost.lan:8181/
  4 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    31.88ms   38.40ms 443.93ms   93.26%

Pluto benchmark

Test pluto-map, from zoom 18 to zoom 0 and given a bounding-box it iterates over a predefined bounding-box to request meaningful tiles (non empty tiles), instead of looping over the whole quad-tree.

Complete cycle (about 90k tiles)

Node v0.10.26 / Mapnik 2.3.x / polygons / pluto map / default style

wrk http://cdb.localhost.lan:8181/ --latency -s scripts/simple_map.lua -d 300 -t 1 -c 20

Geology of Spain benchmark

Test spain-geology-map, from zoom 18 to zoom 0 and given a bounding-box it iterates over a predefined bounding-box to request meaningful tiles (non empty tiles), instead of looping over the whole quad-tree.

30 seconds, 4 threads

Bounding-box: Spain

Node v0.10.26 / Mapnik 2.3.x / polygons / geology of spain / custom style

Empty map benchmark

Test an empty map (no data, no style), from zoom 18 to zoom 0 and given a bounding-box it iterates over a predefined bounding-box to request tiles, instead of looping over the whole quad-tree.

30 seconds, 4 threads

Bounding-box: Spain

Node v0.10.26 / Mapnik 2.3.x / no features / empty map / no style

Lines

Test canada-road-map, from zoom 18 to zoom 0 and given a bounding-box it iterates over a predefined bounding-box to request meaningful tiles (non empty tiles), instead of looping over the whole quad-tree.

30 seconds, 4 threads

Bounding-box: Central Canada

Node v0.10.26 / Mapnik 2.3.x / lines / canada road network / default style

Labels

Tests label speed rendering.

30 seconds, 4 threads

Points (w/o marker, just labels)

z/x/y tiles:

<!DOCTYPE html>
<html>
<body>
<img id="200-body-tile" src="http://localhost:3000/200-body-tile" width="256" height="256">
<img id="429-body-tile" src="http://localhost:3000/429-body-tile" width="256" height="256">
<img id="200-body-no-renderable" src="http://localhost:3000/200-body-no-renderable" width="256" height="256">
<img id="429-body-no-renderable" src="http://localhost:3000/429-body-no-renderable" width="256" height="256">
<script type="text/javascript">
document.getElementById("200-body-tile").addEventListener('load', function () {
console.log('200-body-tile: load')
const express = require('express');
const app = express();
const mw1Factory = function () {
return function mw1 (req, res, next) {
next();
}
}