Hi Patrick, The profiler for the dev_appserver won't be very informative for optimizing your app in production when it comes to the datastore, the datastore on the dev_appserver is basically a flat file.
You should run the profiler in production. Instructions on how to do this can be found in the Google I/O talk Building a Production Quality Application on Google App Engine ( http://sites.google.com/site/io/best-practices---building-a-production-quality-application-on-google-app-engine ). Without having more specific details, I'd say two things off the top of my head are 1) Think about using memcache instead of querying the datastore on every single request. It's unlikely that the query results will change with every request, so there is no need to keep querying the datastore for the same results 2) Don't import expensive modules until you use them -Marzia On Mon, Sep 29, 2008 at 2:19 AM, Hawk-McKain <[EMAIL PROTECTED]> wrote: > > Howdy, Folks > > A short while ago my app started throwing all sorts of nasty "Your app > just used 1.9 times the allocated CPU time!" warning logs for > basically every page load. Apparently I'm having some troubles with > query.fetch which I'm hoping someone can help me sort out. For some > reason just a simple query like the one below causes the profiler to > throw out crazy numbers: "237860 function calls (234982 primitive > calls) in 1.409 CPU seconds" > > query = Profile.all() > query.filter('public =', True) > query.order('-updated') > recent_profiles = query.fetch(5) > > the "Profile" datastore object has: > > - 1 UserProperty > - 2 DateTimeProperties > - 1 BooleanProperty > - 7 StringProperties > - 2 TextProperties > > Also, since this is on my development server I don't have more than 15 > entries. > > My appologies ahead of time for getting any crucial details, I'm a bit > lost on where to go from here since most of my code has been pulled > straight from the docs. > > Thanks in advance for any support, > Patrick > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
