microsoft / microsoft/TypeScript

Type hinting remains slow after version 5.9.2

Offen
#62,484 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand ΓΌbernommen.

Needs More Info
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

πŸ”Ž Search Terms

I use windows 10+ vscode 1.104.1+typescript 5.9.2+
I used valibot (a library similar to zod) in my project
As the code increases, the prompting speed becomes slower and slower. Now it takes about 3 seconds to prompt once (5900x 6c12t)
I have also tried using typescript-go for hinting, but the speed is not fast either (it's a bit faster than the current one, but it still requires waiting)

πŸ•— Version & Regression Information

This problem has always existed, and even after the optimization of types in 5.9.2, it is still slow

⏯ Playground Link

No response

πŸ’» Code

a lot of code define
Approximately one thousand valibot functions were utilized (estimated value; as there are still some references)
like this

export const a=  v.object({
    selection: v.pipe(
      v.optional(v.string()),
      v.description('description'),
    ),
    common: v.pipe(
      v.optional(v.string()),
      v.description('description'),
    ),
  })
πŸ™ Actual behavior

Every time I enter code, I have to wait a few seconds before any prompt appears

πŸ™‚ Expected behavior

not slow

Additional information about the issue

I use https://github.com/microsoft/typescript-analyze-trace print some log
I hope it will be helpful to you

Hot Spots
└─ Check file c:\code\my-project\script\metadata\config.ts (2364ms)
   └─ Check variable declaration from (line 264, char 14) to (line 703, char 3) (2069ms)
      └─ Check expression from (line 264, char 23) to (line 703, char 3) (2068ms)
         └─ Check expression from (line 264, char 32) to (line 703, char 2) (2056ms)
            └─ Check expression from (line 658, char 19) to (line 664, char 4) (1502ms)
               └─ Check expression from (line 659, char 5) to (line 663, char 7) (1501ms)
                  └─ Check expression from (line 659, char 16) to (line 659, char 33) (1499ms)
                     └─ Compare types 47331 and 1049 (1487ms)
                        └─ Compare types 47331 and 942 (1486ms)
                           β”œβ”€ Compare types 47342 and 1049 (876ms)
                           β”‚  └─ Compare types 47342 and 942 (876ms)
                           β”‚     └─ Compare types 47360 and 1049 (864ms)
                           β”‚        └─ Compare types 47360 and 942 (864ms)
                           β”‚           β”œβ”€ {"id":47360,"kind":"GenericInstantiation","name":"OptionalSchema","instantiatedType":564,"typeArguments":[47359,10],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":1}}
                           β”‚           β”‚  β”œβ”€ {"id":564,"kind":"GenericType","name":"OptionalSchema","typeArguments":[565,566],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":1}}
                           β”‚           β”‚  β”‚  β”œβ”€ {"id":565,"kind":"TypeParameter","name":"TWrapped","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":26}}
                           β”‚           β”‚  β”‚  └─ {"id":566,"kind":"TypeParameter","name":"TDefault","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":93}}
                           β”‚           β”‚  β”œβ”€ {"id":47359,"kind":"GenericInstantiation","name":"ObjectSchema","instantiatedType":858,"typeArguments":[47358,10],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":1}}
                           β”‚           β”‚  β”‚  β”œβ”€ {"id":858,"kind":"GenericType","name":"ObjectSchema","typeArguments":[859,860],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":1}}
                           β”‚           β”‚  β”‚  β”‚  β”œβ”€ {"id":859,"kind":"TypeParameter","name":"TEntries","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":24}}
                           β”‚           β”‚  β”‚  β”‚  └─ {"id":860,"kind":"TypeParameter","name":"TMessage","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":56}}
                           β”‚           β”‚  β”‚  β”œβ”€ {"id":47358,"kind":"AnonymousType","location":{"path":"c:\code\my-project\node_modules\@cyia\llama\llama\define\index.d.ts","line":1075,"char":62}}
                           β”‚           β”‚  β”‚  └─ {"id":10,"kind":"Intrinsic","name":"undefined"}
                           β”‚           β”‚  └─ {"id":10,"kind":"Intrinsic","name":"undefined"}
                           β”‚           └─ {"id":942,"kind":"GenericInstantiation","name":"ExactOptionalSchema","instantiatedType":938,"typeArguments":[428,9],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":1}}
                           β”‚              β”œβ”€ {"id":938,"kind":"GenericType","name":"ExactOptionalSchema","typeArguments":[939,940],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":1}}
                           β”‚              β”‚  β”œβ”€ {"id":939,"kind":"TypeParameter","name":"TWrapped","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":31}}
                           β”‚              β”‚  └─ {"id":940,"kind":"TypeParameter","name":"TDefault","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":98}}
                           β”‚              β”œβ”€ {"id":428,"kind":"GenericInstantiation","name":"BaseSchema","instantiatedType":419,"typeArguments":[9,9,427],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":1}}
                           β”‚              β”‚  β”œβ”€ {"id":419,"kind":"GenericType","name":"BaseSchema","typeArguments":[420,421,422],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":1}}
                           β”‚              β”‚  β”‚  β”œβ”€ {"id":420,"kind":"TypeParameter","name":"TInput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":22}}
                           β”‚              β”‚  β”‚  β”œβ”€ {"id":421,"kind":"TypeParameter","name":"TOutput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":30}}
                           β”‚              β”‚  β”‚  └─ {"id":422,"kind":"TypeParameter","name":"TIssue","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":39}}
                           β”‚              β”‚  β”œβ”€ {"id":9,"kind":"Intrinsic","name":"unknown"}
                           β”‚              β”‚  └─ {"id":427,"kind":"GenericInstantiation","name":"BaseIssue","instantiatedType":424,"typeArguments":[9],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":1}}
                           β”‚              β”‚     β”œβ”€ {"id":424,"kind":"GenericType","name":"BaseIssue","typeArguments":[425],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":1}}
                           β”‚              β”‚     β”‚  └─ {"id":425,"kind":"TypeParameter","name":"TInput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":21}}
                           β”‚              β”‚     └─ {"id":9,"kind":"Intrinsic","name":"unknown"}
                           β”‚              └─ {"id":9,"kind":"Intrinsic","name":"unknown"}
                           └─ Compare types 129323 and 1049 (609ms)
                              └─ Compare types 129323 and 942 (609ms)
                                 └─ Compare types 129332 and 1049 (605ms)
                                    └─ Compare types 129332 and 942 (605ms)
                                       β”œβ”€ {"id":129332,"kind":"GenericInstantiation","name":"OptionalSchema","instantiatedType":564,"typeArguments":[129331,10],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":1}}
                                       β”‚  β”œβ”€ {"id":564,"kind":"GenericType","name":"OptionalSchema","typeArguments":[565,566],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":1}}
                                       β”‚  β”‚  β”œβ”€ {"id":565,"kind":"TypeParameter","name":"TWrapped","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":26}}
                                       β”‚  β”‚  └─ {"id":566,"kind":"TypeParameter","name":"TDefault","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6476,"char":93}}
                                       β”‚  β”œβ”€ {"id":129331,"kind":"GenericInstantiation","name":"ObjectSchema","instantiatedType":858,"typeArguments":[129330,10],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":1}}
                                       β”‚  β”‚  β”œβ”€ {"id":858,"kind":"GenericType","name":"ObjectSchema","typeArguments":[859,860],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":1}}
                                       β”‚  β”‚  β”‚  β”œβ”€ {"id":859,"kind":"TypeParameter","name":"TEntries","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":24}}
                                       β”‚  β”‚  β”‚  └─ {"id":860,"kind":"TypeParameter","name":"TMessage","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":6241,"char":56}}
                                       β”‚  β”‚  β”œβ”€ {"id":129330,"kind":"AnonymousType","location":{"path":"c:\code\my-project\node_modules\@cyia\llama\llama\define\index.d.ts","line":11,"char":62}}
                                       β”‚  β”‚  └─ {"id":10,"kind":"Intrinsic","name":"undefined"}
                                       β”‚  └─ {"id":10,"kind":"Intrinsic","name":"undefined"}
                                       └─ {"id":942,"kind":"GenericInstantiation","name":"ExactOptionalSchema","instantiatedType":938,"typeArguments":[428,9],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":1}}
                                          β”œβ”€ {"id":938,"kind":"GenericType","name":"ExactOptionalSchema","typeArguments":[939,940],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":1}}
                                          β”‚  β”œβ”€ {"id":939,"kind":"TypeParameter","name":"TWrapped","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":31}}
                                          β”‚  └─ {"id":940,"kind":"TypeParameter","name":"TDefault","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":4509,"char":98}}
                                          β”œβ”€ {"id":428,"kind":"GenericInstantiation","name":"BaseSchema","instantiatedType":419,"typeArguments":[9,9,427],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":1}}
                                          β”‚  β”œβ”€ {"id":419,"kind":"GenericType","name":"BaseSchema","typeArguments":[420,421,422],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":1}}
                                          β”‚  β”‚  β”œβ”€ {"id":420,"kind":"TypeParameter","name":"TInput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":22}}
                                          β”‚  β”‚  β”œβ”€ {"id":421,"kind":"TypeParameter","name":"TOutput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":30}}
                                          β”‚  β”‚  └─ {"id":422,"kind":"TypeParameter","name":"TIssue","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3277,"char":39}}
                                          β”‚  β”œβ”€ {"id":9,"kind":"Intrinsic","name":"unknown"}
                                          β”‚  └─ {"id":427,"kind":"GenericInstantiation","name":"BaseIssue","instantiatedType":424,"typeArguments":[9],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":1}}
                                          β”‚     β”œβ”€ {"id":424,"kind":"GenericType","name":"BaseIssue","typeArguments":[425],"location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":1}}
                                          β”‚     β”‚  └─ {"id":425,"kind":"TypeParameter","name":"TInput","location":{"path":"c:\code\my-project\node_modules\valibot\dist\index.d.ts","line":3850,"char":21}}
                                          β”‚     └─ {"id":9,"kind":"Intrinsic","name":"unknown"}
                                          └─ {"id":9,"kind":"Intrinsic","name":"unknown"}

Duplicate packages
└─ undici-types
   β”œβ”€ Version 6.21.0 from C:/code/my-project/node_modules/@types/node/node_modules/undici-types
   └─ Version 5.26.5 from C:/code/my-project/node_modules/undici-types

Beitragsleitfaden

Beitragsleitfaden ΓΆffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es ΓΌbernimmst β€” das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Γ–ffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere die Verzâgerung im gemeldeten config.ts-Szenario mit VS Code, TypeScript 5.9.2 und den Valibot-Deklarationen und untersuche anschließend die bereitgestellte Ausgabe von typescript-analyze-trace. Konzentriere dich zunÀchst auf die gemeldeten Prüfungen im Zusammenhang mit OptionalSchema, ObjectSchema und ExactOptionalSchema; abgeschlossen ist die Aufgabe, wenn du eine Verbesserung auf TypeScript-Seite identifiziert und schnelleres Prompting mit einem Regressionsfall nachgewiesen hast.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers, developer-experience
Issue-Typ
Bug
Schwierigkeit
4/5
GeschΓ€tzter Aufwand
3-5 Tage
AktivitΓ€tsstatus
Veraltet
Klarheit
Muss geklΓ€rt werden
AnfΓ€ngerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

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