mapnik / mapnik-support

Use the issues queue here to ask questions and offer help on using Mapnik (maybe if this works well we can retire the mailing list at http://mapnik.org/contact/?)
6 stars 6 forks source link

Rendering is slow after upgrading from Mapnik 2.2 to Mapnik 3.0.16 #106

Open lathaUser opened 6 years ago

lathaUser commented 6 years ago

I have upgraded Mapnik to 3.0.16 and the tiles are loading slowly when compared to Mapnik 2.2.0. I run a C++ test program that loads the map and gets the tiles. I did profiling using Valgrind with land_layers enabled and here are the snapshots. I see lot of calls to agg::multiplier.

Mapnik3 image

Mapnik2 image

flippmoke commented 6 years ago

A very large number of things have changed between 3.0.x and 2.2.x branches, some of these have been improvements to the overall quality of what is produced and placement of things such as labels. Others have been bug fixes, enhancements etc. It is very hard to compare as so much has changed. Full development on 2.2 ended in around 2013/2014, so there are many major differences in the entire architecture of mapnik. What might seem like a performance slow down might be the result of a critical bug fix that required a slowdown in a situation such as this.

I wouldn't spend a ton of time comparing here unless you can point out specific areas that need improvement in current mapnik. The 3.0.16 profile you are showing is spending time in AGG, which is good because this is the rendering spend the majority of the time (which we would expect), so that alone is not a bad sign. Your benchmarks also don't show me any information about how you compiled mapnik in both situations. It is very possible that debug related builds are slower now then they were before, but production builds are actually faster (just one of many different possible examples). Additionally, you are testing one single type of rendering and mapnik supports so many different types.

All of that said -- I don't want to discourage someone from looking at performance in mapnik. There are likely many ways we could improve performance across the entire library. If you are looking for a simple solution however, I am not sure you will find one here.

lathaUser commented 6 years ago

I have used scons to build mapnik. I have added XMPARSER and XML2_CONFIG options for Mapnik3 as libxml2 is not default anymore. I have not used the DEBUG option. Let me know if you see anything wrong with the options.

Mapnik3 python scons/scons.py --config=force XMLPARSER=libxml2 XML2_CONFIG=/usr/bin/xml2-config BOOST_INCLUDES=/usr/local/lib64/BOOST/include BOOST_LIBS=/usr/local/lib64/BOOST/lib PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ THREADING=multi PG_CONFIG=$POSTGRES_LOC/pg_config PROJ_LIBS =/usr/lib64 INPUT_PLUGINS=all

python scons/scons.py --config=force THREADING=multi install XMLPARSER=libxml2 PG_CONFIG=$POSTGRES_LOC/pg_config INPUT_PLUGINS=all

Mapnik2

python scons/scons.py --config=force BOOST_INCLUDES=/usr/local/lib64/BOOST/include BOOST_LIBS=/usr/local/lib64/BOOST/lib PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ THREADING=multi PG_CONFIG=$POSTGRES_LOC/pg_config INPUT_PLUGINS=all

python scons/scons.py --config=force THREADING=multi install PG_CONFIG=$POSTGRES_LOC/pg_config INPUT_PLUGINS=all