Do not process partial tiles if no new resources have arrived
Partial tiles are now only processed again when there is a new resource available. If we don't have new resources - like new glyphs - the end result of the reparsing is the same, because no new SymbolBuckets would are created. In my tests debugging with PowerTOP, this patch drops the CPU utilization during the sampling period from 100ms/s to 40ms/s. The improvements on slow connections (i.e. more time waiting for resources) are even more noticeable.
This commit is contained in:
@@ -384,7 +384,8 @@ void Source::update(MapData& data,
|
||||
GlyphStore& glyphStore,
|
||||
SpriteAtlas& spriteAtlas,
|
||||
util::ptr<Sprite> sprite,
|
||||
TexturePool& texturePool) {
|
||||
TexturePool& texturePool,
|
||||
bool shouldReparsePartialTiles) {
|
||||
if (!loaded || data.getAnimationTime() <= updated) {
|
||||
return;
|
||||
}
|
||||
@@ -407,7 +408,8 @@ void Source::update(MapData& data,
|
||||
|
||||
switch (state) {
|
||||
case TileData::State::partial:
|
||||
handlePartialTile(id, style.workers);
|
||||
if (shouldReparsePartialTiles)
|
||||
handlePartialTile(id, style.workers);
|
||||
break;
|
||||
case TileData::State::invalid:
|
||||
state = addTile(data, transformState, style, glyphAtlas, glyphStore,
|
||||
|
||||
Reference in New Issue
Block a user