Skip to content

Perf regression: preserving union aliases #43422

Closed
@amcasey

Description

@amcasey

I'm seeing ~1.5s of check time in 0c58ede and ~5s of check time in 6aeb8c1 (aka #42149).

Note that the repro is really brittle - virtually any change causes the check time to drop dramatically (including: inlining the .d.ts contents in the .ts file, using a type alias for the array type, even dropping the width property).

The real CSSObject type is from https://github.com/emotion-js/emotion.

index.ts

import type { CSSObject } from "./emotion";

declare const width: string | number;
declare const y: CSSObject;

const x: CSSObject = {
    width,
    ...y,
};

emotion.d.ts

import * as CSS from 'csstype'

type CSSProperties = CSS.PropertiesFallback<number | string>
type CSSPropertiesWithMultiValues = {
  [K in keyof CSSProperties]:
    | CSSProperties[K]
    | Array<Exclude<CSSProperties[K], undefined>>
}

interface ArrayCSSInterpolation extends Array<CSSInterpolation> {}
// type ArrayCSSInterpolation = Array<CSSInterpolation>;

type InterpolationPrimitive =
  | null
  | undefined
  | boolean
  | number
  | string
  | CSSObject

type CSSInterpolation = InterpolationPrimitive | ArrayCSSInterpolation

interface CSSOthersObject {
  [propertiesName: string]: CSSInterpolation
}

export interface CSSObject extends CSSPropertiesWithMultiValues, CSSOthersObject {}

Note that you'll need to npm install csstype.

Command: tsc index.ts -skipLibCheck -noEmit -extendedDiagnostics

Metadata

Metadata

Assignees

Labels

Domain: PerformanceReports of unusually slow behaviorNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions