City-of-Helsinki / open-city-helsinki

Mobile app for open cities built with React Native
Other
1 stars 1 forks source link

Optimize Android performance and memory use #10

Open petterill opened 6 years ago

petterill commented 6 years ago

The app uses quite a lot of memory ~200mb. Probably the large Linked Events images are the culprits for at least some memory use.

spjass commented 6 years ago

Did some optimization on mapview markers. Now only markers inside the map view area (and near vicinity) are drawn. Markers are drawn and hidden after the map view are has changed. This seems to have a positive impact on memory use. Haven't had any crashes from running out of memory after these changes.

However it might have a slight negative impact on user experience. If the user for example moves the map far from Helsinki center and then moves the map back, it takes about a second before the markers are drawn to the map, due to so many markers being in that area. That means that from the user's point of view for a second it looks like there are no markers, until they pop up on the map.