ui
ui copied to clipboard
iOS slow performance when having hundreds of Markers
The mapview moves smoothly until we add ~300 markers with icons of 35x35 and a UIlabel popup window (hidden).
After adding the markers it goes slowly, like it draws each marker on the MainThread (blocking the UI while calculating the rendering for 300 markers).
Just FYI, I was tracking down the source of the slowness, and it seems to be related to the view.ToViewPort call in the MarpMarker.SetLayout method.
That ends up calling RectangleF2.TransformTo, which seems to do some heavy calculations. I can see that calling that routine 400 times per frame would make things go slow. I would suggest a solution, but I am not sure why the complex calculation is needed (seems to me that TransformTo is already given a 2d coordinate, that only needs to be scaled/translated to the current viewport).
Yes, that is some of the worst code still in there. Need to change that to a simple 2D scale/translate operation...