Replies: 5 comments 14 replies
-
Nearly 9 CPU hours in
|
Beta Was this translation helpful? Give feedback.
-
The z13 building merge (and other polygon merges) are very expensive, 14.5 CPU hours are spent in When called from
|
Beta Was this translation helpful? Give feedback.
-
Mbtiles writing doesn't take a very long time (12 minutes), but it can't be parallelized so turns into a single-threaded bottleneck that we haven't been able to improve. I thought that #219 or #245 might improve things, but the time ends up remaining unchanged. Does anyone else have any ideas to reduce the sqlite write time? Here are the connection settings we use currently: And the table schemas we use for compact mode: planetiler/planet-logs/v0.5.0-planet-c6gd-128gb.txt Lines 675 to 699 in 74b7474 |
Beta Was this translation helpful? Give feedback.
-
I have to say, performance is already miles ahead of any previous solution that I'm aware of, so don't sweat it too much.... Still, more performance is always nice. Out of interest, I looked up pricing for the EC2 instance you use, and you've gotten to the point where exporting the complete MBTiles out of Amazon costs far more than the compute time needed to generate the tiles in the first place! |
Beta Was this translation helpful? Give feedback.
-
Another approach if people wanted to get the generation time down by spending more money would be to add This doesn't seem like a great option since 4x-ing the cost to only gets you from 38 to 16 minutes, and at the end you're left with 4 mbtiles files that need to be merged or have a tile server that knows which file to route each request to but maybe that's a tradeoff someone wants to make 🤷♂️ Also this would only be beneficial after implementing #119 so that each time we run, we use up-to-the-minute OSM input. |
Beta Was this translation helpful? Give feedback.
-
I addressed some obvious single-threaded bottlenecks in the 0.5.0 release and am planning to take a break from performance improvements for a bit. Here's a summary of where the remaining time goes when processing the planet, in case others had further ideas they wanted to try?
These performance charts show generating the planet on a c6gd.16xlarge EC2 instance with 64 cpus and 128GB
ram with z13 building merge (53m, left) and without (38m, right). The details below include the z13 building merge.
VisualVM Profile
See this gist or load the profile for a detailed breakdown of where the CPU time goes in each thread, but here's a summary of the hot spots:
com.onthegomap.planetiler.render.FeatureRenderer.renderLineOrPolygon
: 15 hourscom.onthegomap.planetiler.geo.GeoUtils.snapAndFixPolygon
: 8 hourscom.onthegomap.planetiler.render.TiledGeometry.sliceIntoTiles
: 2.65 hourscom.onthegomap.planetiler.render.TiledGeometry.sliceY
: 1 hourcom.onthegomap.planetiler.render.TiledGeometry.sliceX
: 0.9 hourcom.onthegomap.planetiler.render.TiledGeometry.addShapeToResults
: 0.65 hourscom.onthegomap.planetiler.collection.FeatureGroup.encodeValue
: 1.37 hourscom.onthegomap.planetiler.geo.DouglasPeuckerSimplifier.simplify
: 1 hourcom.onthegomap.planetiler.expression.MultiExpression$KeyIndex.getMatchesWithTriggers
: 1 hourcom.onthegomap.planetiler.VectorTile.encodeGeometry
: 0.7 hourscom.onthegomap.planetiler.reader.osm.PbfDecoder.decode
: 0.7 hourscom.onthegomap.planetiler.FeatureMerge.mergeNearbyPolygons
: 14 hours, 13 of those fromBuilding.postProcess
com.onthegomap.planetiler.util.Gzip.gzip
: 1.4 hours gzipping tilescom.onthegomap.planetiler.FeatureMerge.mergeLineStrings
: 1.2 hours, 0.85 hours fromTransportation.postProcess
com.onthegomap.planetiler.geo.GeoUtils.snapAndFixPolygon
: 0.85 hourscom.onthegomap.planetiler.VectorTile.encode
: 0.75 hourscom.onthegomap.planetiler.collection.FeatureGroup$TileFeatures.decodeVectorTileFeature
: 0.71 hourscom.onthegomap.planetiler.mbtiles.Mbtiles$BatchedTableWriterBase.flush
: 11.9 minutes, 11.5 of that inorg.sqlite.jdbc3.JDBC3PreparedStatement.execute
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions