Reduce repeated Need-graph lookups when rereading report templates

Ouverte
#1,078 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python
Domaine
performance

Piste de recherche

Profile _reread_post_template_pages and _LinkedNeeds._resolve_backlinks in src/extensions/score_sphinx_needs_templates/__init__.py. Read how _get_available_needs() combines the live graph with the saved Needs and how backlink resolution includes outgoing links; compare that behavior with the existing report output fixtures, including mounted cross-document reports. Done means the reread pass is faster while preserving live updates, backlink order, version-qualified IDs and duplicate handling.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

performance

What

Rereading seven report pages after Sphinx merges the parallel reader environments took about 14 seconds in Reference Integration. The report templates do this second pass so their tables can see Needs and links from other documents.

Technical approach

Profile _reread_post_template_pages and _LinkedNeeds._resolve_backlinks in src/extensions/score_sphinx_needs_templates/__init__.py. The current helper can scan all Needs for each backlink lookup and copy the graph to overlay temporarily removed Needs. Test a reverse-link index for the reread pass and an overlay that avoids copying the full mapping. Preserve live updates during document replacement, backlink order, version-qualified IDs and duplicate handling.

Measurement and reproduction dump

The env-updated hook _reread_post_template_pages took 13.905 s with 36,806 Needs in a local build of Reference Integration #501 using docs-as-code v9.0.0. The seven pages use templates marked score: render-after-needs-collection. The marked templates are module_verification_report, platform_verification_report and tool_qualification_report.

_get_available_needs() combines the current graph with the snapshot of Needs cleared for rereading. _resolve_backlinks() merges pre-existing backlinks with outgoing links from the live collection because some links have been injected and the upstream backlink index can still be incomplete. Any index needs to reflect that same view, including changes from earlier pages in the reread.

In the same phase trace, test import took 16.146 s, source/test link injection 5.680 s and bundle metadata 0.070 s. The 13.905 s number measures the whole reread callback. The proposed lookup changes have not been benchmarked. Compare with instrumented handler timings and existing report output fixtures, including mounted cross-document reports.

Related performance measurements and CI context are in https://github.com/eclipse-score/docs-as-code/issues/1075.

Langage dominant
Python
Étoiles
11
Forks
39
Merge moyen
1 j 13 h
PR mergées (30 j)
65

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de eclipse-score/docs-as-code

Toutes les issues de eclipse-score/docs-as-code

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.