On Mon, May 22, 2017 at 10:12 PM, Bernd Wechner <bernd.wechner@gmail.com> wrote:
James,
If you have the fortitude and kind heart to look at it, sure the code base (just checked in) is here:
https://github.com/bernd-wechner/CoGs
<snip>
That's quite a code repo. Bravo. I did poke through it a bit, thank you for the extensive comments and properly formatted code. Helped tremendously.
However, nothing jumped out as the culprit. Given that the render* and other output functions seem to be suspect, I'd do the following:
- You didn't mention your specific Django version. If 1.11, try backing it off to 1.10, and if on 1.10, try upgrading to 1.11. The reason being is that there were some significant changes to the template rendering system in 1.11 that may be causing excessive calls.
- Determine how many objects and related objects you are dealing with during the slow page rendering. Your queries may be quick, but coercing a large number of objects into Django models and then coercing them again in to form elements may be problematic.
- Determine where the culprit code in the templates is (or if it is template rendering at fault). Try attaching the view to a blank template and see if you get the same result. If so, start adding pieces of the template back in until you find the problem area. The view/template in question renders several forms. Commenting them out may help track down which form is at fault. There could possibly be a circular dependency somewhere causing the form rendering process to go crazy as well (ie Session ties to League, Location, and Game, but League ties together Location and Game). Given the other optimizations for related models you've added, there might be a loop somewhere. This also feels a bit de-normalized.
- The pprint.py thing is really bugging me, as there shouldn't be any reason to ever call that. Might be useful to do an interactive debug to step through and see what is causing those calls, or if they are red herrings from the profiling process, etc.
Give that a shot and let me know.
-James
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXnuomTDLD61WEard8-a%3DSRQkZUkHYn6Y_m3UkWVV6w_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment