I upgraded Google Maps v1 to v2 in my Android app.
And v2 was enjoyable and so on, but one method seems to be the slowest in my life.
Projection proj = map.getProjection(); Point point = proj.toScreenLocation(example.m_geopoint);
toScreenLocation (...) is so slow that the application slows down to an unacceptable slowdown. The method is updated, perhaps 100 times per frame, but it works very well on Google Maps v1.
And when I look at the Android console, I see the following:
10-06 13:53:04.460: D/dalvikvm(4889): GC_EXPLICIT freed 251K, 14% free 14622K/16839K, paused 3ms+5ms 10-06 13:53:05.859: D/dalvikvm(4889): GC_EXPLICIT freed 252K, 14% free 14622K/16839K, paused 2ms+5ms 10-06 13:53:07.222: D/dalvikvm(4889): GC_EXPLICIT freed 251K, 14% free 14622K/16839K, paused 3ms+6ms ...
This message exits all the time while the method is being called.
And the difference between v2 and v1 is this:
pointOut = proj.toScreenLocation(geopointIn); // v2 projection.toPixels(geopointIn, pointOut); // v1
And v1 seems to be a more optimized solution. Is there any way to get this faster? Is this a performance bug?
source share