Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Excessive symbolizer copying during load_map #1293
It appears that, at least for the RasterSymbolizer, the copy ctor is called 7 times for an XML file like:
<Map background-color="white" srs="+init=epsg:32630"> <Style name="ramped"> <Rule> <RasterSymbolizer /> </Rule> </Style> <Layer name="dataraster" srs="+init=epsg:32630"> <StyleName>ramped</StyleName> <Datasource> <!-- get stats on this file with gdalinfo ../raster/dataraster.tif -stats --> <Parameter name="file">../raster/dataraster.tif</Parameter> <Parameter name="type">gdal</Parameter> <Parameter name="band">1</Parameter> </Datasource> </Layer> </Map>
A quick half-solution would be to replace the vector typedefs with deque. Then there'd be just one copy upon insertion, but still the inner container (sym_) would be copied wholly in add_rule. To avoid all unnecessary copies, we'd have to store ptrs.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
@lightmare - boost:ptr_vector and fiends are designed to work with auto_ptr
the above snippet nothing to do with c++11 :P