On the other hand, I think you can enable DB performance measurements in Moodle (and MySQL too, look for 'slow queries' in this same forum). Yes, here it is, from config-dist-php:
// Performance profiling
// If you set Debug to "Yes" in the Configuration->Variables page some
// performance profiling data will show up on your footer (in default theme).
// With these settings you get more granular control over the capture
// and printout of the data
// Capture performance profiling data
// define('MDL_PERF' , true);
// Capture additional data from DB
// define('MDL_PERFDB' , true);
// Print to log (for passive profiling of production servers)
// define('MDL_PERFTOLOG' , true);
// Print to footer (works with the default theme)
// define('MDL_PERFTOFOOT', true);
So maybe you could define MDL_PERF and MDL_PERFDB and have a look at the numbers to see if the slowdown comes from MySQL or from Moodle.
[Edit: This thread seems interesting
Having the same problem in assignment mod is slowing down. I did check if the group having more and more activity the slower the assigment module.
I looking for a patch or something to accelerate the assignment mod. Thanks
After a series of test, I therefore conclude its the cuplication of activity causes the slow down