WIDE-Services / ws_block_course_statistics_u

0 stars 0 forks source link

Potential performance issues #9

Open volodymyrdovhan opened 1 day ago

volodymyrdovhan commented 1 day ago

Hello,

  1. The plugin may impact performance as it interacts with Moodle's logstore table. In large systems, the logstore table can contain millions of records, which may cause the plugin's task to process data for an extended time or even overload the database. I recommend generating a large dataset to emulate a real system and testing the plugin on a large logstore table.

  2. All plugin data tables currently operate on the client side with loading data all at once. Please consider rebuilding them to use server-side processing, with server-side pagination and AJAX calls to improve performance.

Thank you for your plugin.

dorispanos commented 19 hours ago

Hello,

Thank you for your feedback and for highlighting the performance considerations regarding the plugin's interaction with Moodle's logstore table.

I understand the potential impact on performance, especially in large systems where the logstore table can contain millions of records. To address this, the plugin currently uses a scheduled task that runs once a day to collect the necessary time data, minimizing the load during peak usage times. Additionally, users have the flexibility to select which courses should be measured, allowing them to focus on specific courses as needed rather than processing all courses at once. This can help manage resource usage and reduce the load on the system.

Regarding the data tables, I recognize that currently, they load data all at once on the client side. I plan to enhance this aspect in a future update by transitioning to server-side processing. This will involve implementing server-side pagination and AJAX calls to ensure smoother handling of large datasets and improve overall performance.

Thank you again for your suggestions, and I appreciate your guidance in making the plugin better suited for larger installations. I will keep you updated on the progress of these improvements.