Recent investigations into poor performance of our moodle 2.4 candidate release have uncovered a number of concerns including the use of lib.php.
lib.php is included from many locations through the code, so the file needs to be as small as possible, no include other files, and only hold functions which are truly needed outside the scope of the plug-in.
Where require_once is necessary in lib.php, it should be within a specific function rather than at the top of the file (different to normal coding guidelines about require_once).
I've looked at questionnaire/lib.php which appears to have a number of functions which may be internal only, and it also includes its own locallib.php and eventlib.php at the top of the file.
This issue is to restructure lib.php and locallib.php where necessary in order to meet the current best practice and hopefully have a small impact on overall Moodle performance.