|
[
Permalink
| « Hide
]
Dan Poltawski added a comment - 14/Feb/09 07:31 AM - edited
Adding Petr here as he did some perf work on my moodle page for 1.9
Biggest offender appears to be assignment module (disabling drops to 810 queries)
Spent about 2mins hacking up this patch.
Before: time: 5.975912s - dbqueries: 12400 Will look a bit deeper tomorrow (for instance in this case it might useful to find out if php test vs large db packet is more efficient). Real life perfmance log entry:
[Fri Feb 13 09:57:52 2009] [error] PERF: /my/ time: 708.269655s memory_total: 16262224B (15.5MB) memory_growth: 16210736B (15.5MB) memory_peak: 17764064B (16.9MB) includecount: 105 dbqueries: 12874 ticks: 70844 user: 2382 sys: 259 cuser: 0 csys: 0 serverload: 1.90 rcache: 0/19 there is a bug for this somewhere already I think, +1 for commit
Hesitate because I did no testing! Will need to do that. thanks for encouragement.
I think we can remove another set in-loop dbq too. Ps: this raises an interesting question related to a 'joinable' database table for enrolments - in this case would it help us at all, cos we'd have to check each individual capabiltity? (devils advocate here) New patch which takes all the sql I think we can out of the loops. Its a shame I don't we can't get rid of the get_users_by_capability() call, but still a big improvement.
Real query numbers before/after: Need to do a bit more testing and then will commit. Ooops, that patch introduced a regression on checking for markedness. Here is a new one
I've done some further testing and have commited this to CVS. Please test!
Reviewed code, and it looks good. (You even avoided the mistakes I usually make when merging DB code from 1.9 -> 2.0
Hmm. Unfortunately, I have just found another bug. If the assignment is set to separate groups, and (non-editing) teachers don't have 'accessallgroups', then the display on the My Moodle page is wrong. However, that was wrong before, and your reworking does not change that, so I will file a separate bug. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||