If I have a pair of floats, is it any more efficient (computationally or storage-wise) to store them as a GeoPtProperty than it would be pickle the tuple and store it as a BlobProperty?
If GeoPt is doing something more clever to keep multiple values in a single property, can it be leveraged for arbitrary data? Can I store the tuple ("Johnny", 5) in a single entity property in a similarly efficient manner?
Here are some empirical answers:
GeoPtPropertyuses 31B of storage space.Using
BlobPropertyvaries based on what exactly you store:struct.pack('>2f', lat, lon)=> 21B.In short, it doesn’t look like
GeoPtis doing anything particularly clever. If you are going to be storing a lot of these, then you could usestructto pack your floats. Packing and unpacking them withstructwill probably be unnoticeably different from the CPU cost associated with serializing/deserializingGeoPt.If you plan on storing lots of floats per entity and space is really important, then you might consider leveraging the
CompressedBlobPropertyin aetycoon.Disclaimer: This is the minimum space required. Actual space will be slightly larger per property based on the length of the property’s name. The model itself also adds overhead (for its name and key).