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:
Thiago Marcos P. Santos
2015-05-07 16:09:15 +03:00
parent 41dc5e836a
commit 3f445e8578
4 changed files with 15 additions and 4 deletions

View File

@@ -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,