One way to find out would be to just do a test.. create a model called
PotMemberDeux and make pot = db.StringProperty() in that one.. then test how
long those puts take by assigning pot="p" and use the same put code.

I'd guess that both of the puts referencing the same pot=p could be what is
slowing it down.. granted, I don't use ReferenceProperty at all... so, what
do I know..

On Wed, Sep 8, 2010 at 9:24 AM, Christopher Staite <
[email protected]> wrote:

> Hi guys,
>
> I've been trying write my first real application for the app engine.
> After multiple re-writes I've finally got the hang of things.  I think
> that I've got something efficient and correct.  However, it's still
> not performing particularly quickly and I'd like to speed it up a
> little more.
>
> The main issue is that most calls have to place two entries into the
> datastore:
>
> class PotMember(db.Model):
>        pot = db.ReferenceProperty(Pot)
>        member_id = db.IntegerProperty()
>        count = db.IntegerProperty()
>        second_pot = db.BooleanProperty()
>        purchase_time = db.DateTimeProperty(auto_now_add=True)
>        process_time = db.DateTimeProperty(auto_now=True)
>
> newMembers = []
> newMembers.append(PotMember(pot=p, member_id=member_id, count=count,
> second_pot=False))
> newMembers.append(PotMember(pot=p, member_id=member_id,
> count=second_count, second_pot=True))
> db.put(newMembers)
>
> This operation takes ~300-400ms, which is enough for App Engine to
> complain that my application is executing too slowly and needs to be
> "optimised".  What exactly is taking so long to place these entries?
> Most other put() operations take ~10ms to complete.  Is it the use of
> the DateTimeProperty or the use of the ReferenceProperty that is
> slowing this call down?
>
> Any help would be appreciated.
>
> Many Thanks, Chris.
>
> --
> 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]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
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.

Reply via email to