HermitCrab analysis: defer the per-template clone in AnalysisAffixTemplateRule (1.054x wall-clock, not a step count)
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
- 45/100
- Type d'issue
- Refactorisation
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- csharp
- Domaine
- performance
Piste de recherche
Start with the optimization record at docs/optimizations/deferred-template-clone.md and the disposition in docs/hermitcrab-perf-2026-09-disposition.md, then inspect AnalysisAffixTemplateRule.Apply and its emission points. First establish whether the target already clones lazily; measure steps or allocations and verify parity with a signature covering gloss, allomorph index, and syntactic feature structure. Done means the measured change is justified and parity holds.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
AnalysisAffixTemplateRule.Apply makes an internal engine clone of the input, freezes it once per template, and runs the slot DFS on the clone. The input is already frozen at every call site and slot rules never mutate it, so the DFS can run on the input directly. Only the two emission points that can pass the input through unchanged (ApplySlots terminal, ParallelApplySlots push) need a frozen clone. The traced path keeps the eager clone, because the trace manager stamps CurrentTrace onto the words it is given. The change is on the archived branch perf/hc-optimization-archive.
Measured. Clone-discard count (Amharic): 2,505 clones created, 1,659 discarded (66%). Wall-clock A/B on 45 Sena words, min of two interleaved rounds: 1.054x overall, 1.02x to 1.08x on heavy words. No step count was recorded. Parity was checked with WordAnalysisSignature, which on Sena compares morph counts only.
What a revival must do first. Re-measure in steps or allocations rather than wall time. Check parity with a gloss, allomorph-index and syntactic-feature-structure signature, not morph counts. The saving is allocation only, so a port that already clones lazily gains nothing.
Record: see the archived write-up below
Ledger: https://github.com/sillsdev/machine/pull/490#issuecomment-6701971116; disposition: https://github.com/sillsdev/machine/pull/490#issuecomment-6701971324
From #490 (closed).
- Langage dominant
- C#
- Étoiles
- 29
- Forks
- 16
- Merge moyen
- 4 j 11 h
- PR mergées (30 j)
- 14
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de sillsdev/machine
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
HermitCrab: one partial rule switches off the final-template prune for the whole grammar; Mbugwe chaanjiyɛ never finishesPeut-être pris @johnml1135 l’a pris aujourd’hui. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
Les mainteneurs répondent en général sous 1 jour
-
Hermit Crab performance
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Hermit Crab performance
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de sillsdev/machine
Issues similaires
-
bug emitter:client:csharp
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
microsoft/typespec#12572 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
needs-area-label
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
area-networking
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
dotnet/aspnetcore#70545 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
Les mainteneurs répondent en général sous 1 jour