| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
TypeScript Bot (@typescript-bot) test it |
Sorry, something went wrong.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
|
Hey Anders Hejlsberg (@ahejlsberg), the results of running the DT tests are ready. Everything looks the same! |
Sorry, something went wrong.
There was a problem hiding this comment.
The cache must distinguish read and write simplification modes to avoid reusing incorrect results.
Review effort: Balanced
Findings: 1
Adds caching for simplified conditional types to improve checker performance.
Changes:
| File | Description |
|---|---|
| tsc/internal/checker/checker.go | Caches conditional-type simplification results. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| } | ||
|
|
||
| func (c *Checker) getSimplifiedConditionalType(t *Type, writing bool) *Type { | ||
| key := CachedTypeKey{kind: CachedTypeKindSimplifiedConditionalType, typeId: t.id} |
There was a problem hiding this comment.
regression tests for the above:
type Value<T extends { a: string; b: number }> = T["a" | "b"] extends unknown
? T["a" | "b"]
: never;
function test<T extends { a: string; b: number }>(value: Value<T>, a: T["a"]) {
const read: T["a"] | T["b"] = value;
const write: Value<T> = a; // errors
}
Sorry, something went wrong.
|
Anders Hejlsberg (@ahejlsberg)
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Anders Hejlsberg (@ahejlsberg) Here are the results of running the user tests with tsc comparing baseline and pr: Everything looks good! |
Sorry, something went wrong.
|
Anders Hejlsberg (@ahejlsberg) Here are the results of running the top 400 repos with tsc comparing baseline and pr: Everything looks good! |
Sorry, something went wrong.
|
No measurable effect on perf tests, likely because we don't have react tests which is where it's supposed to help. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
With this PR we consistently cache results in getSimplifiedType. Previously, we cached results for indexed access types but not conditional types. Found in performance experiments by Bun team.