Skip to content
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

Improved tile retrieval during rendering #9

Merged
merged 2 commits into from
Sep 8, 2014

Conversation

scottdewald
Copy link
Contributor

Really appreciate your hard work on Mapsui. It is an awesome project!

When performing recursive searches for tiles to render in RenderGetStrategy, I converted the resolution dictionary to a sorted list at the beginning of the search and used indices to move up to lower resolutions instead of performing dictionary look ups each time. This greatly improves performance when tiles are not found right away resulting in multiple recursive calls.

I first noticed this performance problem when I had multiple layers - one had tiles down to level 19 and the other only to level 11. When zoomed into level 19, it was taking a (relatively) long time to find tiles in the top layer which only goes to level 11 and therefore the screen would stutter when dragging my WPF application. With the below improvement, it drags much more smoothly.

When performing recursive searches for tiles to render, I converted the
resolution dictionary to a sorted list and used indices to move up to
lower resolutions instead of performing dictionary look ups each time.
This greatly improves performance when tiles are found right away
resulting in multiple recursive calls.
@pauldendulk pauldendulk merged commit e43d082 into Mapsui:master Sep 8, 2014
@pauldendulk
Copy link
Member

Great patch! I added a unit test for the original method and then did some performance comparisons with the new one. It is now about 10 times faster. Thanks a lot.

@scottdewald
Copy link
Contributor Author

Sweet! I've been impressed with how smooth/quick the Mapsui WPF map runs.
You did some neat tricks in there.

I'm working on map rotation now...

On Mon, Sep 8, 2014 at 4:11 PM, Paul den Dulk notifications@github.com
wrote:

Great patch! I added a unit test for the original method and then did some
performance comparisons with the new one. It is now about 10 times faster.
Thanks a lot.


Reply to this email directly or view it on GitHub
https://github.com/pauldendulk/Mapsui/pull/9#issuecomment-54888046.

@pauldendulk
Copy link
Member

Eventually I would like to replace WPF rendering (Mapsui.Rendering.Xaml) with a hardware accelerated renderer like OpenGL (that I now use on iOS and Android) or DirectX.

Rotation will have a bigger impact. How will you approach it? Perhaps we should open een new issue to discuss it.

@scottdewald
Copy link
Contributor Author

Still looking at how to possibly handle rotation, but as you mentioned in a
comment back in May, looks like the Viewport with need rotation/orientation
and then the fetcher and renderer will both need to know about it.
Thankfully the fetcher and renderer utilize the same
TileSchema.GetTilesInView() method in BruTile, but this method might need
rotation passed in as well.

If you would like it done a different way let me know, but I hope to have a
prototype within the next day or two.

On Mon, Sep 8, 2014 at 4:37 PM, Paul den Dulk notifications@github.com
wrote:

Eventually I would like to replace WPF rendering (Mapsui.Rendering.Xaml)
with a hardware accelerated renderer like OpenGL (that I now use on iOS and
Android) or DirectX.

Rotation will have a bigger impact. How will you approach it? Perhaps we
should open een new issue to discuss it.


Reply to this email directly or view it on GitHub
https://github.com/pauldendulk/Mapsui/pull/9#issuecomment-54891277.

@pauldendulk
Copy link
Member

ah here is the issue for iOS/Android
https://github.com/pauldendulk/Mapsui/issues/8
I created a new issue for WPF
https://github.com/pauldendulk/Mapsui/issues/10
I will add few comments there now. I will have little time for this the coming days.

@scottdewald
Copy link
Contributor Author

Want me to continue working on the rotation for the viewport, fetcher, and
wpf renderer or do you want me to wait until you have more time? My project
will need this feature within the next week or two.

Sent from my "smart" phone
On Sep 9, 2014 4:04 AM, "Paul den Dulk" notifications@github.com wrote:

ah here is the issue for iOS/Android
#8 https://github.com/pauldendulk/Mapsui/issues/8
I created a new issue for WPF
#10 https://github.com/pauldendulk/Mapsui/issues/10
I will a few comments there now. I will have little time for this the
coming days.


Reply to this email directly or view it on GitHub
https://github.com/pauldendulk/Mapsui/pull/9#issuecomment-54942524.

@pauldendulk
Copy link
Member

Better to just start. Not sure if I will have time later. I will try to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants