You may want do have a look at an old benchmark I did (back in summer
2008) on different methods to load a batch of object from the
datastore:
http://groups.google.com/group/google-appengine/browse_thread/thread/bef7c4dcd2c42b6d

>From what I remember, replacing the parsing of protocol buffer to
represent the model's properties as a tuple instead of a dictionary
saved about 30% of CPU on the load operation. Not something that you
want to generalize because of the maintenance issue (you have to
manually handle missing properties), but may be worthwhile to apply in
a few performance sensitive place.

Though, the best is to run your sensitive code under a profiler on
gae. There is the instruction to do so somewhere in the doc as your
model may stress other parts of the loading chain.

Also back then I did not have Nick trick (using protocol buffer
serialization) for efficient use of caching: it was faster to reload
than pickling/unpickling cached model!

2009/10/10, Jason Smith <j...@proven-corporation.com>:
>
> Hi, group. My app's main cost (in dollars and response time) is in the
> db.get([list, of, keys, here]) call in some very high-trafficked code.
> I want to pare down the size of that model to the bare minimum with
> the hope of reducing the time and CPU fee for this very common
> activity. Many users who are experiencing growth in the app popularity
> probably have this objective as well.
>
> I have two questions that hopefully others are thinking about too.
>
> 1. Can I expect the API time of a db.get() with several hundred keys
> to reduce roughly linearly as I reduce the size of the entity?
> Currently the entity has the following data attached: 9 String, 9
> Boolean, 8 Integer, 1 GeoPt, 2 DateTime, 1 Text (avg size ~100 bytes
> FWIW), 1 Reference, 1 StringList (avg size 500 bytes). The goal is to
> move the vast majority of this data to related classes so that the
> core fetch of the main model will be quick.
>
> 2. If I do not change the name of the entity (i.e. just delete all the
> db.*Property definitions in the model), will I still incur the same
> high cost fetching existing entities? The documentation says that all
> properties of a model are fetched simultaneously. Will the old
> unneeded properties still transfer over RPC on my dime and while users
> wait? In other words: if I want to reduce the size of my entities, is
> it necessary to migrate the old entities to ones with the new
> definition? If so, is it sufficient to re-put() the entity, or must I
> save under a wholly new key?
>
> Thanks very much to anyone who knows about this matter!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to