Hi Dave,
Thanks for responding. Below are my code details :
from google.appengine.ext import db
_DEBUG = True
class Feris(db.Model):
pengarang = db.StringProperty()
content = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)
def test():
for i in range(1, 1000):
ferisrecord = Feris(pengarang = "Feris Thia" + str(i), content="Great
app" + str(i))
ferisrecord.put()
if __name__ == "__main__":
test()
On Mon, Oct 6, 2008 at 12:16 AM, davew <[EMAIL PROTECTED]> wrote:
> Hi Feris,
>
> Are you testing it locally, or live? (The datastore can be slow for
> puts locally.)
>
Both, in local it is much slower. I have screen captures from entity's
console
For live - 12 records per second - this is the screenshot :
http://lh5.ggpht.com/feristhia.phi/SOoieKZ6LMI/AAAAAAAAAnQ/S_I-fWMglCc/s800/data_entity_live.png
For local - 427 records in about 3 minutes -
http://lh6.ggpht.com/feristhia.phi/SOojGA3bmrI/AAAAAAAAAnY/OX_ahoI-jFk/s800/data_entity_local_page_1.png
http://lh5.ggpht.com/feristhia.phi/SOojGMwqXlI/AAAAAAAAAng/9Q78KxGn8IA/s800/data_entity_local_page_48.png
> Are you trying to update the same records, or 1000 unique records?
>
Unique records.
>
>
> If you are doing 27 updates per second, are you ramping up, and
> ramping down your requests when you run tests? Try to simulate a
> smooth usage graph, rather than a spikey one.
>
I'm not get you quite well on this. I just use a pure for loop.
>
>
> Have you tried profiling your code live with something like:
> import logging
> import cProfile, pstats, StringIO
> prof = cProfile.Profile()
> prof = prof.runctx("self.your_main_function()", globals(),
> locals())
> stream = StringIO.StringIO()
> stats = pstats.Stats(prof, stream=stream)
> stats.sort_stats("time") # Or cumulative
> stats.print_stats(400) # how many to print
> stats.print_callees()
> stats.print_callers()
>
> msg = "Profile: \n%s" % stream.getvalue()
> logging.info(msg)
>
Will try on this. Thanks.
>
>
> What are the 3 fields? Are they indexed?
>
No, they are not indexed. The model is Feris with 2 String and 1 Datetime
field as showed above.
I notice that the fastest in live environment is 27 records/second. Is there
any good suggestions on how to improve my code ?
Thanks,
Feris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---