Skip to content

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

Draft
glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/716-to-main
Draft

glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/716-to-main

Conversation

@glpi-project

@glpi-project glpi-project Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Forward-port of #716 to main.

  • 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 %

@glpi-project

glpi-project Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin forward-port/716-to-main
git worktree add --checkout .worktree/forward-port/716-to-main forward-port/716-to-main
cd .worktree/forward-port/716-to-main
git reset --hard HEAD^
git cherry-pick -x 98486d9077cdfd8c1f9c1e5758bc454b2e2d9e1e

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.

1 participant