cgeo/c-geo-opensource — Issue #696: storeWithMerge is bad strategy
Author: Bananeweizen
Created: 2011-10-21 17:19:35+00:00
State: open
Labels: refactoring

When we currently store a cache, then we always load the (potentially) existing current cache with the same geocode from the database, merge the old cache into the new one and store the new one.

This is generally fine and gives correct results (so we have the most recent fields and so on). But this approach takes a huge amount of time. For most of our search operations (like "near me"), the storeWithMerge() is responsible for half the runtime. So it would be good if we could implement the merge differently (e.g. by only writing the newer values into the database, avoiding loading the cache details at all).