Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Do not process partial tiles if no new resources have arrived - #1461

Merged
tmpsantos merged 5 commits into
masterfrom
1458-partial_tiles_reparse
May 18, 2015
Merged

tmpsantos merged 5 commits into
masterfrom
1458-partial_tiles_reparse

Conversation

@tmpsantos

Copy link
Copy Markdown
Contributor

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.

Fixes #1458

@tmpsantos

Copy link
Copy Markdown
Contributor Author

@kkaefer @jfirebaugh please review

@tmpsantos
tmpsantos force-pushed the 1458-partial_tiles_reparse branch from 91d2a63 to 9d6698b Compare May 7, 2015 18:11
@tmpsantos
tmpsantos force-pushed the 1458-partial_tiles_reparse branch 3 times, most recently from 93b9e28 to 67025d7 Compare May 12, 2015 07:41
@tmpsantos
tmpsantos force-pushed the 1458-partial_tiles_reparse branch from 67025d7 to 5b86c57 Compare May 15, 2015 09:52
@tmpsantos tmpsantos added ready performance Speed, stability, CPU usage, memory usage, or power usage and removed in progress labels May 15, 2015
tmpsantos added 5 commits May 18, 2015 10:42
For now, keep a pointer so we can subscribe/unsubscribe to events. In
the future, we should move this object completely to ResourceLoader, but
we can't do it now because we delete the ResourceLoader when changing
the style.
We were previously emitting the signal on the thread parsing the
glyph, but signals can only be trigger from the MapThread
because the observers are living there.
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.
When parsing a tile, we request resources from the network, like
sprites and glyphs.

In the rare case of the resources arriving before the tile is
parsed for the first time, if we don't mark it for being parsed
again, it can end up with a tile eternally stuck in the partial
state.
We only emit signals when the number of buckets increase (i.e. the
new data that arrived added a new bucket to the tile).

Also, if we try to reparse a partial tile but it is not possible, we
keep the flag up for trying to reparse it again on the next update,
because the data might have arrived after the bucket that is waiting
for the data was processed but before the end of the parsing.

Fixes #1458
@tmpsantos
tmpsantos force-pushed the 1458-partial_tiles_reparse branch from 5b86c57 to aaaf1e4 Compare May 18, 2015 08:08
tmpsantos added a commit that referenced this pull request May 18, 2015
Do not process partial tiles if no new resources have arrived
@tmpsantos
tmpsantos merged commit 0f46810 into master May 18, 2015
@mourner mourner removed the ready label May 18, 2015
@tmpsantos
tmpsantos deleted the 1458-partial_tiles_reparse branch May 18, 2015 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

performance Speed, stability, CPU usage, memory usage, or power usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partial tiles constantly being reparsed

3 participants