-
Notifications
You must be signed in to change notification settings - Fork 986
-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple maintenance() calls possibly impacting performance #1128
Comments
We probably can close this. My long[] mTileIndices (in MapTileList) is 301 elems long and the loop in |
@pasniak Looking back at the code there might be a couple of possible (but light) improvements. |
First thing: be sure that you pulled the latest version of master. I recently removed a duplicated code execution regarding A solution would be to increase the capacity using Another solution would be to use smaller protected tile sets (cf. I'm also working on the following idea: adding a message in the log. Something like "You'd have better performances with a tile cache capacity of xxx, or with smaller protected-cache-tile sets". |
I am trying to get my head around the ensureCapacity... (where to set it? do you have an example?) |
Something like But I'm actually PR'ing something called |
👍 the computers are beyond my pay grade... |
Just PR'ed #1131 |
Btw the concept of protected tile is not that hard to understand - I assume. The idea is to say "OK we currently display those tiles, but there's a good chance we'll soon need tiles for zooms +-1 or tiles at the border". getTileCache().getProtectedTileComputers().add(new MapTileListZoomComputer(-1)); // zoom -1
getTileCache().getProtectedTileComputers().add(new MapTileListZoomComputer(1)); // zoom +1
getTileCache().getProtectedTileComputers().add(new MapTileListBorderComputer(1, false)); // border of 1 around, and just the border And what happens is that during the
|
The next thing I would like to fix is the "is that tile in the protected list?" algorithm. |
Done in #1131 |
Removed class: * `LRUMapTileCache`: already deprecated class, removed _en route_ Impacted classes: * `IConfigurationProvider`: impacted the removal of `LRUMapTileCache` in comments; gently refactored * `MapTileCache`: new `boolean mAutoEnsureCapacity` and its getter; optimized method `garbageCollection` using `mAutoEnsureCapacity`; method `ensureCapacity` now returns a `boolean` ("actually changed the capacity?"); optimized method `shouldKeepTile` * `MapTilePreCache`: added a little optimization in method `fill`; fixed typos * `MapTileProviderBasic`: set the new `MapTileCache.mAutoEnsureCapacity` to `true`
… MapTileArea `MapTileArea` now replaces `MapTileList` in most operations, for performance reasons. In `MapTileAreaTest.testPerformances` on a 100 item list: the init phase goes 50 times faster, the lookup phase goes about twice faster for an item in the list, and 10 times faster for an item not in the list. New classes/interface: * `MapTileArea`: a zoom/xmin/xmax/ymin/ymax tile area, that replaces the array of tile indices kept in `MapTileList` for performance reasons * `MapTileAreaTest`: a unit test class for `MapTileArea` * `MapTileAreaList`: a list of `MapTileArea` * `MapTileAreaListTest`: a unit test class for `MapTileAreaList` * `MapTileAreaComputer`: Compute a map tile area from a map tile area source, replacing `MapTileListComputer` * `MapTileAreaBorderComputer`: Compute a map tile area from a map tile area source - the source with a border * `MapTileAreaBorderComputerTest`: a unit test class for `MapTileAreaBorderComputer` * `MapTileAreaZoomComputer`: Compute a map tile area from a map tile area source - the source on another zoom level * `MapTileAreaZoomComputerTest`: a unit test class for `MapTileAreaZoomComputer` Deprecated classes/interface: * `MapTileListComputer` * `MapTileListBorderComputer` * `MapTileListBorderComputerTest` * `MapTileListZoomComputer` * `MapTileListZoomComputerTest` Other impacted classes: * `MapTileCache`: replaced `MapTileList*` with `MapTileArea*`; created `private` method `refreshAdditionalLists` for code readability * `MapTileCacheTest`: replaced `MapTileList*` with `MapTileArea*` * `MapTilePreCache`: replaced `MapTileList` with `MapTileAreaList` * `MapTileProviderBasic`: replaced `MapTileList*` with `MapTileArea*` * `TilesOverlay`: replaced `MapTileList*` with `MapTileArea*`
Impacted class: * `MapTileAreaTest`: removed a risky performance test
feature/osmdroid#1128 - faster MapTileCache management
@pasniak ping |
Why, when scrolling around I get multiple maintenance() calls which seem to slow down the display (see screenshots)? Maybe the should be compacted into periodic call?
Issue Type
[x] Question
[ ] Bug
[ ] Improvement
[ ] Build system related
[x] Performance
[ ] Documentation
Description and/or steps/code to reproduce the problem
The text was updated successfully, but these errors were encountered: