Reduce repeated Need-graph lookups when rereading report templates

Offen
#1,078 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
performance

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
11
Forks
39
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
65

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus eclipse-score/docs-as-code

Alle Issues in eclipse-score/docs-as-code

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.