ILIAS icon indicating copy to clipboard operation
ILIAS copied to clipboard

NW: Performance optimization

Open thojou opened this issue 1 month ago • 2 comments

The goal of this MR is to refactor the News component to optimize the dashboard loading times reported in Mantis https://mantis.ilias.de/view.php?id=46452. Multiple analyses have shown that long dashboard load times are caused by inefficient processes and code sections in the News component. This refactoring aims to optimize three key areas:

Database

  • Table il_news_item: Introduce a composite index on (context_obj_id, context_obj_type, creation_date)
  • Implement validation through plain SQL logic using EXISTS
  • Use optimized SQL queries with prepared statements

Implementation of a Two-Tier Caching Model

  • Global Cache: The raw news data (without user-specific information) should be stored in a global cache accessible to all users. The object’s RefID can be used as the key.
  • User-Specific Cache: Only user-specific data, particularly the individual news feed, is stored in this cache. When displaying messages, this data is enriched with that from the global cache.

Architecture

  • Introduction of a Repository Layer: All database query logic will be moved from ilNewsItem into a new class, e.g., ilNewsRepository. ilNewsItem will become a pure Data Transfer Object.
  • Separation of Business Logic: The logic for aggregating and preparing data will be moved from ilNewsForContextBlockGUI into a dedicated service class. This allows for targeted loading (eager loading) and caching of dependencies (tree) and object information.
  • Avoidance of Redundancy through reference-based operations — similar to object pooling or linking logic in the magazine.

This change set has been tested on a large customer installation that initially reported the issue. The loading time of the News component has been reduced to a minimum. Two different approaches were used for testing:

  1. Manual comparison between current ILAS 9 and patched ILIAS 9 by enabling/disabling different components on the dashboard.
  2. Performance evaluation platform using synthetic data approximating the size of the customer’s dataset. With the patch applied, rendering the News component on the dashboard takes around ~500ms.

If requested, we can also provide more detailed information about the new implementation structure and performance analysis results.

The PR has mainly be developed by @lukas-heinrich.

We would love to bring this changes into the release_9 as it has been developed and tested for this Version. We are looking forward to feedback.

Best Regards, @thojou

thojou avatar Dec 03 '25 13:12 thojou

We would like to discuss this PR at the next JourFixe on 08 Dec 2025. The reason is that we intend to include these changes in release_9. Therefore, if the JourFixe approves this PR, we plan to proceed with the merge in the following days.

thojou avatar Dec 03 '25 13:12 thojou

Jour Fixe, 08 DEC 2025: Bug fix has been accepted by Jour Fixe. Related PR can be merged to release_9 and higher. Thank you very much for this improvement of performance.

matthiaskunkel avatar Dec 08 '25 12:12 matthiaskunkel

Hey @lukas-heinrich,

thanks for the PR and the improvements. I've integrated the changes into release_9, release_10, release_11 and trunk.

Best Regards, @thojou

thojou avatar Dec 15 '25 12:12 thojou