[Marble-devel] [Patch] Add class TileId because int is not sufficient for higher zoom levels
Torsten Rahn
torsten.rahn at credativ.de
Thu Apr 24 23:51:31 CEST 2008
On Thursday 24 April 2008 22:17:21 Jens-Michael Hoffmann wrote:
Hi,
I like the approach however I've also done some performance measurement and on
my computer I get a performance difference between 15.9fps before applying
the patch and 11.48 fps after applying the patch. That's a performance
decrease of 28% which unfortunately isn't acceptable. :-/
So we've got to find some less expensive solution here.
Looking at the patch I'd bet that the problematic lines are in TileLoader.cpp
line 183 ff as these get called very often during rendering:
Your new implementation creates a new tileId object each time the method is
called and searching the hash and the cache requires a lot of overhead by
introducing a lot more rather expensive comparisons to do:
TileId tileId( tileLevel, tilx, tily );
// If the tile hasn't been loaded into the m_tileHash yet, then do so...
if ( !d->m_tileHash.contains( tileId ) ) {
if ( d->m_tileCache.contains( tileId ) ) {
tile = d->m_tileCache.take( tileId );
d->m_tileHash[tileId] = tile;
Maybe as a workaround you could compare or lookup tileId's by pointers or by
a "temporary" Id which just gets assigned to each tile while the tile is
located in the hash/cache. This would effectively get us back to an int
comparison and hence remove the speed penalty of this feature.
Best Wishes,
Torsten
--
Torsten Rahn
Tel.: 0 21 61 - 46 43 - 192
credativ GmbH, HRB Mönchengladbach 12080
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz
More information about the Marble-devel
mailing list