Skip to content

Conversation

@Orthane
Copy link

@Orthane Orthane commented Jun 4, 2025

Reduced Database Calls

Key Optimizations:

  • Introduced a static variable in format_designer\options::get_options to cache options for each course module.
  • Modified format_designer\options::get_option to use the cached result from get_options instead of triggering new database queries.

These changes significantly reduce the number of database calls, especially in courses with a large number of modules or sections.

Performance Impact (30 course modules)

  • Before optimization: Over 800 database calls, load time > 20 seconds.
  • After optimization: Only 30 database calls, load time < 1 second.

Improved Memory Usage

  • Replaced several get_records calls with get_recordset, particularly in operations involving sections and videotime modules, to reduce memory consumption.
  • Incorporated filtering logic directly into SQL queries, minimizing the need for additional processing or follow-up queries in PHP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant