openequella/moodle-mod_openEQUELLA

Attempt to further optimise equella_list_courses_for_user web service call

mrblippy opened this issue · 2 comments

An Edalex client's moodle takes around 30 seconds to list courses using the equella_list_courses_for_user web service call (the code lives inside externallib.php)

There was an effort performed in the past to optimise this 32acf74#diff-f232daf9e853b92201e86b2262bc9aca
Part of that fix involved caching the course results. So perhaps that's no longer working?

jonof commented

If the user is an admin or similarly privileged user of the Moodle site, it can take a very long time to respond with a list of modifiable courses as every course in the system is individually permission checked and returned in the service response. In my test I've seen a 4.75min delay computing the response. However, with the improvements to efficiency in get_user_capability_course() with Moodle 3.4, the same result can be achieved much faster. My test: 3.5sec.

There's a commit in my fork which has the change that I'm currently evaluating, but as I haven't had an organisational CLA for my employer sent off yet, and thus no individual CLA either, it won't be accepted for merging.

Jonathon

I will take a look at that commit today, thanks for the explanation @jonof