The included path made my test boxes (both Windows and Linux) to run rebuild_course_cache() 50% faster. I tested with a large Moodle site (tens of thousands of resources), and in those cases upgrading from 1.6.3 to 1.7 called rebuild_course_cache() for all courses.
The patch does the following
1) in get_array_of_activities() only the columns "section, sequence" are required from the sections table
2) resource_get_coursemodule_info() read all of the resource data. The "alltext" column can be quite large. Only the columns "id, name, type, reference, popup" are required. The resource "name" is stored to the info field also.
3) get_array_of_activities() had one query for resource/activity name only. Now, if it's already read in step 2), then it is read from the $info, otherwise it's read as before. This generates one less query per resource.