Skip to content

Fix(Perf): index models_id, check model rights in one pass and render mapping rows server-side - #716

Open
Herafia wants to merge 2 commits into
11.0/bugfixesfrom
perf_models_list_and_mappings
Open

Herafia wants to merge 2 commits into
11.0/bugfixesfrom
perf_models_list_and_mappings

Conversation

@Herafia

@Herafia Herafia commented Nov 17, 2026

Copy link
Copy Markdown
Contributor
  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • Instance: GLPI 11.0 (e2e environment), datainjection 2.15.12, debug mode off
  • Data: 5 000 models, 297 100 mappings, 29 745 infos, 2 000 computers; hot models with 300 mappings and 100 infos
  • Measured scenarios: model list, injection page, Mappings and Additional Information tabs of a hot model, injection of a 100-line CSV, central page
  • Measurement method: median of 5 runs after a warm-up (browser Performance API); SQL from the MariaDB slow log at a zero threshold
  • SQL: add an index on models_id (install and migration), check the rights of all models with one query per table, compute the duplicate-column check once per batch, render the field dropdowns of each row in the tab instead of 2 AJAX calls per row, release the session in the row endpoints, load datainjection.js on the plugin pages only, drop the isActivated() check

SQL Queries

Scenario Without plugin Before After Difference
Model list - 6 955 (47.7 s) 99 (0.11 s) -98.6 %
Injection page - 12 808 (93 s) 136 (0.16 s) -98.9 %
Mappings tab, 300 columns - 14 931 (602 requests) 129 (2 requests) -99.1 %
Injection of 100 lines - 3 258 (3.1 s) 3 132 (0.56 s) -82 % SQL time
glpi_plugins per request 8 12 10 -2

Response Times

Scenario Before After Difference
Model list (server) 47 985 ms 161 ms -99.7 %
Injection page (server) 93 524 ms 218 ms -99.8 %
Mappings tab, 300 columns (fully loaded) 54 644 ms 517 ms -99.1 %
Additional Information tab (fully loaded) 13 229 ms 1 919 ms -85.5 %
Injection of 100 lines 4 119 ms 1 421 ms -65.5 %

@Herafia Herafia self-assigned this Nov 17, 2026
@Herafia Herafia changed the title Fix(Perf): index models_id, check model rights in one pass and render… Fix(Perf): index models_id, check model rights in one pass and render mapping rows server-side Nov 17, 2026
@Herafia
Herafia requested review from a team, Mary-Clb, Rom1-B, RomainLvr and jdurand-teclib and removed request for a team and jdurand-teclib November 17, 2026 10:03
Comment thread inc/injectiontype.class.php Resolved
Comment thread ajax/dropdownChooseField.php Resolved
@Herafia
Herafia requested a review from Rom1-B November 18, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants