On Mon, 2011-12-05 at 11:36 +0100, Masklinn wrote: > > > https://bitbucket.org/lawgon/djangogolf/src/a86c388f1795/web/views.py#cl-372 > analyses golf scores and calculates the relative difficulty of the holes. The > code looks simple to me, but to analyse 10,000 rounds of golf (1,80,000 hole > scores) my 2 GB laptop takes 20 minutes. Would this be considered normal - or > slow? If slow, ideas on how to speed it up would be appreciated. > It certainly does not seem fast, but I don't think it's possible to > psychically debug that stuff, so you'll need to collect stats on which > section of the function takes time: > > * The first half looks like straightforward numerical code (three > iterations on three straightforward-looking querysets back-to-back, > but not nested), while Python is not the fastest language at numerical > stuff, even CPython "only" takes ~100ms for 2 million additions (on a > 2.4GHz Core i5)
this is what takes the time > * The gviz_api work could be more expensive (CPU-wise) than the simple > calls let think takes a few seconds > * Depending on the amount of data generated, the issue could also come > from rendering the data the amount of data generated is minimal - 18 sets of data containing one string and 2 numbers each. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.