Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation of Mapnik XML file is long #60

Closed
Phyks opened this issue Feb 17, 2019 · 0 comments · Fixed by #66
Closed

Generation of Mapnik XML file is long #60

Phyks opened this issue Feb 17, 2019 · 0 comments · Fixed by #66
Assignees
Labels
help wanted Extra attention is needed

Comments

@Phyks
Copy link
Member

Phyks commented Feb 17, 2019

It currently takes at least 5 minutes to generate it, which is quite painful. :/

gravitystorm/openstreetmap-carto#1941 could probably give some hints for optimizing.

Current benchmark is, on my laptop

Parsing time: 9ms
Parsing time: 2ms
Parsing time: 3ms
Parsing time: 11ms
Parsing time: 52ms
Parsing time: 45ms
Parsing time: 15ms
Parsing time: 17ms
processing layer: land-low
Inheritance time: 0ms
processing layer: land-high
Inheritance time: 1ms
processing layer: landuse_gen0
Inheritance time: 3ms
processing layer: landuse_gen1
Inheritance time: 2ms
processing layer: landuse
Inheritance time: 2ms
processing layer: waterway_low
Inheritance time: 0ms
processing layer: waterway_med
Inheritance time: 0ms
processing layer: waterway_high
Inheritance time: 5ms
processing layer: water_gen0
Inheritance time: 0ms
processing layer: water_gen1
Inheritance time: 0ms
processing layer: water
Inheritance time: 0ms
processing layer: landuse_overlays
Inheritance time: 1ms
processing layer: buildings
Inheritance time: 0ms
processing layer: aeroway
Inheritance time: 2ms
processing layer: tunnel
Inheritance time: 16291ms
processing layer: turning_circle_case
Inheritance time: 0ms
processing layer: roads_high
Inheritance time: 1123ms
processing layer: roads_med
Inheritance time: 1ms
processing layer: roads_low
Inheritance time: 0ms
processing layer: turning_circle_fill
Inheritance time: 0ms
processing layer: bridge
Inheritance time: 14327ms
processing layer: bicycle_routes
Inheritance time: 5ms
processing layer: bicycle_routes_labels
Inheritance time: 0ms
processing layer: country-names
Inheritance time: 1ms
processing layer: capital-names
Inheritance time: 2ms
processing layer: state-names
Inheritance time: 0ms
processing layer: placenames-medium
Inheritance time: 4ms
processing layer: placenames-small
Inheritance time: 2ms
processing layer: area_label
Inheritance time: 23ms
processing layer: waterway_label
Inheritance time: 1ms
processing layer: train_stations
Inheritance time: 0ms
processing layer: amenities-poly
Inheritance time: 64ms
processing layer: amenities-points
Inheritance time: 28ms
processing layer: barriers
Inheritance time: 0ms
processing layer: amenities-poly-text
Inheritance time: 5ms
processing layer: amenities-points-text
Inheritance time: 5ms
processing layer: highway_area_label
Inheritance time: 17ms
processing layer: roads-text-ref-low-zoom
Inheritance time: 0ms
processing layer: roads-text-ref
Inheritance time: 3ms
processing layer: roads-text-name
Inheritance time: 33ms
processing layer: paths-text-name
Inheritance time: 1ms
TOTAL: 112817ms

Which is quite weird because total time does not seem to match with the sum of other listed times :/

mapbox/carto#20 might be of interest as well.

EDIT: Same machine, running carto on openstreetmap-carto takes 40s. Running it on CyclOSM takes 5 minutes.

EDIT2: Without layers tunnel and bridge (mentions removed from roads.mss file), we are down to 20s compilation!

@Phyks Phyks added the help wanted Extra attention is needed label Feb 17, 2019
Phyks added a commit to Phyks/cyclosm-cartocss-style that referenced this issue Feb 20, 2019
Compiling the project to a Mapnik XML file was taking a lot of time,
mainly due to the tunnel and bridge layers. Here are some fixes to
improve compilation time.

* Use attachments for tunnels and bridges instead of selecting all the
data three times from the database and filtering on it.
* Rework the filtering in `roads.mss` file to avoid having too many
levels of imbrication, responsible for a lot of overhead at compilation.
* Remove the upper zoom limit as there is no reason to stop displaying
the roads above zoom 20.

Before this PR, compilation time obtained through

```
\time carto cyclosm-cartocss-style/project.mml > /dev/null
```

was of about 5 minutes.

It is now of 24 seconds.

Fixes cyclosm#60.
@Phyks Phyks self-assigned this Feb 20, 2019
@Phyks Phyks closed this as completed in #66 Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant