Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
329e60b
tsgo init
iisaduan Mar 12, 2026
f647c14
if statements
iisaduan Mar 12, 2026
31cab4d
more conditionals
iisaduan Mar 12, 2026
d6c18f7
fix var
iisaduan Mar 12, 2026
6d2ad62
ref
iisaduan Mar 12, 2026
1c470a4
fix `REF`
iisaduan Mar 12, 2026
645f7f0
fix bool
iisaduan Mar 12, 2026
b180810
fix setup scripts
iisaduan Mar 17, 2026
c0f403a
route to correct tsc executable
iisaduan Mar 17, 2026
8f8351c
oops, make correct exe name
iisaduan Mar 17, 2026
2497a0b
test more fixes?
iisaduan Mar 18, 2026
6063786
debug
iisaduan Mar 18, 2026
9d12375
move debug
iisaduan Mar 19, 2026
9997264
fix IS_PR to work with manual trigger
iisaduan Mar 19, 2026
ae05706
fix REF variable
iisaduan Mar 19, 2026
0b30911
post perf results to the correct repo
iisaduan Mar 19, 2026
233a036
error message "expected ref to start with"
iisaduan Mar 19, 2026
2608d8a
host
iisaduan Mar 19, 2026
4caea86
fix test
iisaduan Mar 19, 2026
8856050
fake native host
iisaduan Mar 20, 2026
c6b2da9
make tsgo executable
iisaduan Mar 23, 2026
dec7dc3
add "tsc" to command line args
iisaduan Mar 23, 2026
2f9f6f9
remove debug variables and fix tsserver
iisaduan Mar 24, 2026
b9edbab
allow lsp
iisaduan Mar 28, 2026
0888c3b
add lsp to setup pipeline
iisaduan Mar 30, 2026
990f846
clean up
iisaduan Mar 30, 2026
8a8f32e
bump versions
iisaduan Mar 31, 2026
90a5c18
format ...?
iisaduan Mar 31, 2026
6c87b46
add snaps for tsgo testing
iisaduan Mar 31, 2026
e4fce58
set tested version of "microsoft/typescript" to be tsgo-port
iisaduan Mar 31, 2026
c974893
dont set --cpus when tsgo
iisaduan Mar 31, 2026
fcd445f
format/remove unused imports
iisaduan Mar 31, 2026
858b837
add 'configTime` and `memoryAllocs` to results table
iisaduan Apr 1, 2026
7a36319
allow table to match eitherconfig time or parse time
iisaduan Apr 3, 2026
c54b2f5
unbreak startup tests
iisaduan Apr 6, 2026
1c778cf
flip filter
iisaduan Apr 6, 2026
89bd7ff
Merge branch 'main' of https://github.com/microsoft/typescript-benchm…
iisaduan Apr 6, 2026
b6cb575
skip self-build-src-public-api when tsgo
iisaduan Apr 6, 2026
bfba76c
update tests
iisaduan Apr 6, 2026
054bc4d
fix table (again)
iisaduan Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 45 additions & 14 deletions build/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ resources:
type: github
endpoint: Microsoft
name: microsoft/TypeScript
- repository: typescript-go
type: github
endpoint: Microsoft
name: microsoft/typescript-go

# https://stackoverflow.com/a/63276774
pipelines:
Expand Down Expand Up @@ -85,6 +89,10 @@ parameters:
displayName: Exhaustive list of agents
type: string
default: 'any,ts-perf1,ts-perf2,ts-perf3,ts-perf4,ts-perf5,ts-perf6,ts-perf7,ts-perf8,ts-perf9,ts-perf10,ts-perf11,ts-perf12'
- name: TS_GO
displayName: boolean to describe if building ts-go
type: boolean
default: false

variables:
Codeql.Enabled: false
Expand All @@ -95,7 +103,15 @@ variables:
azureSubscription: 'TypeScript Public CI'
KeyVaultName: 'jststeam-passwords'

REF: $[ resources.repositories['TypeScript'].ref ]
${{ if eq(parameters.TS_GO, true) }}:
REPO: 'typescript-go'
REF: $[ replace(resources.repositories['typescript-go'].ref, 'heads/../', '') ]
TSGOFLAG: '--tsgo'
${{ else }}:
REPO: 'TypeScript'
REF: $[ replace(resources.repositories['TypeScript'].ref, 'heads/../', '') ]
TSGOFLAG: ''

PRETTY_REF: $[ replace(replace(replace(replace(variables['REF'], '/merge', ''), 'refs/pull/', 'pr.'), 'refs/heads/', ''), '/', '_') ]
IS_PR: $[ startsWith(variables['REF'], 'refs/pull/') ]
# True if this run should demand a baseline machine.
Expand All @@ -122,19 +138,27 @@ jobs:

variables:
ARTIFACTS_DIR: $(Pipeline.Workspace)/artifacts
TYPESCRIPT_DIR: $(Pipeline.Workspace)/TypeScript
TYPESCRIPT_DIR: $(Pipeline.Workspace)/$(REPO)
TSPERF_PRESET: ${{ parameters.TSPERF_PRESET }}

steps:
- template: templates/setup.yml
- template: templates/cloneAndBuildBenchmarkRepo.yml # Sets $(BENCH_SCRIPTS), $(TSPERF_EXE)

- checkout: TypeScript
path: TypeScript
fetchTags: false
fetchDepth: 2 # For PRs, we want the merge base to compare against.
clean: true
retryCountOnTaskFailure: 3
- ${{ if eq(parameters.TS_GO, true) }}:
- checkout: typescript-go
path: typescript-go
fetchTags: false
fetchDepth: 2 # For PRs, we want the merge base to compare against.
clean: true
retryCountOnTaskFailure: 3
- ${{ else }}:
- checkout: TypeScript
path: TypeScript
fetchTags: false
fetchDepth: 2 # For PRs, we want the merge base to compare against.
clean: true
retryCountOnTaskFailure: 3

# Ideally we'd just do this:
# git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
Expand All @@ -146,7 +170,7 @@ jobs:
set -exo pipefail
OLD_REF=`git -C $(TYPESCRIPT_DIR) rev-parse HEAD`
rm -rf $(TYPESCRIPT_DIR)
git clone --filter=blob:none https://github.com/microsoft/TypeScript $(TYPESCRIPT_DIR)
git clone --filter=blob:none https://github.com/microsoft/$(REPO) $(TYPESCRIPT_DIR)
cd $(TYPESCRIPT_DIR)
git fetch origin $(OLD_REF)
git switch --detach FETCH_HEAD
Expand All @@ -160,6 +184,8 @@ jobs:
node $(BENCH_SCRIPTS)/setupPipeline.js
displayName: Setup pipeline
name: setupPipeline
env:
TSGOFLAG: $(TSGOFLAG)

- bash: |
set -exo pipefail
Expand All @@ -170,7 +196,7 @@ jobs:

- bash: |
set -exo pipefail
node $(BENCH_SCRIPTS)/buildTypeScript.js --outputDir $(ARTIFACTS_DIR)/new
node $(BENCH_SCRIPTS)/buildTypeScript.js --outputDir $(ARTIFACTS_DIR)/new $(TSGOFLAG)
displayName: Build new TypeScript
condition: and(succeeded(), eq(variables['TSPERF_IS_COMPARISON'], 'true'))
workingDirectory: $(TYPESCRIPT_DIR)
Expand All @@ -185,7 +211,7 @@ jobs:

- bash: |
set -exo pipefail
node $(BENCH_SCRIPTS)/buildTypeScript.js --baseline --outputDir $(ARTIFACTS_DIR)/baseline
node $(BENCH_SCRIPTS)/buildTypeScript.js --baseline --outputDir $(ARTIFACTS_DIR)/baseline $(TSGOFLAG)
displayName: Build baseline TypeScript
workingDirectory: $(TYPESCRIPT_DIR)
name: buildTypeScriptBaseline
Expand Down Expand Up @@ -226,6 +252,12 @@ jobs:
artifact: BuiltTypeScript
displayName: Download built TypeScript

- ${{ if eq(parameters.TS_GO, true) }}:
- bash: |
set -exo pipefail
find $(BUILT_TYPESCRIPT_DIR) -name 'tsgo' -type f -exec chmod +x {} +
displayName: Make tsgo executable

# This is provided by the agent.
- bash: |
set -exo pipefail
Expand All @@ -237,7 +269,6 @@ jobs:
node $(BENCH_SCRIPTS)/runTsPerf.js install-hosts
displayName: Install hosts
retryCountOnTaskFailure: 3

- bash: |
set -exo pipefail
# Special case for self benchmark
Expand Down Expand Up @@ -397,7 +428,7 @@ jobs:

- bash: |
set -exo pipefail
node $(BENCH_SCRIPTS)/postPerfResult.js --fragment $(Pipeline.Workspace)/comment.html
node $(BENCH_SCRIPTS)/postPerfResult.js --fragment $(Pipeline.Workspace)/comment.html $(TSGOFLAG)
displayName: Publish PR comment
condition: and(succeeded(), eq(variables['IS_PR'], 'true'))
env:
Expand Down Expand Up @@ -480,7 +511,7 @@ jobs:

- bash: |
set -exo pipefail
node $(BENCH_SCRIPTS)/postPerfResult.js --failed
node $(BENCH_SCRIPTS)/postPerfResult.js --failed $(TSGOFLAG)
displayName: Publish PR comment
env:
DISTINCT_ID: ${{ parameters.DISTINCT_ID }}
Expand Down
4 changes: 4 additions & 0 deletions build/templates/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ steps:
inputs:
versionSpec: ${{ parameters.NODE_VERSION }}
displayName: 'Install Node ${{ parameters.NODE_VERSION }}'
- task: GoTool@0
inputs:
version: '1.26'
displayName: 'Install Go'

- bash: |
set -exo pipefail
Expand Down
46 changes: 46 additions & 0 deletions cases/scenarios/Compiler-UnionsLSP/scenario.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "Compiler-UnionsLSP",
"kind": "lsp",
"args": [],
"tsserverConfig": {
"solution": "Compiler-Unions",
"commands": [
{
"commandName": "updateOpen",
"args": [
{
"file": "checker.ts"
}
]
},
{
"commandName": "geterr",
"args": [
"checker.ts"
]
},
{
"commandName": "references",
"args": {
"file": "checker.ts",
"line": 10960,
"offset": 48
}
},
{
"commandName": "navto",
"args": {
"searchValue": "Type"
}
},
{
"commandName": "completionInfo",
"args": {
"file": "checker.ts",
"line": 25149,
"offset": 6
}
}
]
}
}
46 changes: 46 additions & 0 deletions cases/scenarios/CompilerLSP/scenario.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "CompilerLSP",
"kind": "lsp",
"args": [],
"tsserverConfig": {
"solution": "Compiler",
"commands": [
{
"commandName": "updateOpen",
"args": [
{
"file": "checker.ts"
}
]
},
{
"commandName": "geterr",
"args": [
"checker.ts"
]
},
{
"commandName": "references",
"args": {
"file": "checker.ts",
"line": 11696,
"offset": 48
}
},
{
"commandName": "navto",
"args": {
"searchValue": "Type"
}
},
{
"commandName": "completionInfo",
"args": {
"file": "checker.ts",
"line": 26636,
"offset": 6
}
}
]
}
}
6 changes: 5 additions & 1 deletion cases/scenarios/self-build-src-public-api/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ cd "${0%/*}"

source ../../common.sh

clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
if [ -n "$TSGOFLAG" ]; then
clone_scenario https://github.com/microsoft/TypeScript.git
Comment thread
iisaduan marked this conversation as resolved.
Outdated
else
clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
fi

run_sandboxed sh -c '
npm ci
Expand Down
6 changes: 5 additions & 1 deletion cases/scenarios/self-build-src/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ cd "${0%/*}"

source ../../common.sh

clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
if [ -n "$TSGOFLAG" ]; then
clone_scenario https://github.com/microsoft/TypeScript.git
else
clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
fi

run_sandboxed sh -c '
npm ci
Expand Down
6 changes: 5 additions & 1 deletion cases/scenarios/self-compiler/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ cd "${0%/*}"

source ../../common.sh

clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
if [ -n "$TSGOFLAG" ]; then
clone_scenario https://github.com/microsoft/TypeScript.git
else
clone_scenario https://github.com/microsoft/TypeScript.git $TYPESCRIPT_COMMIT
fi

run_sandboxed sh -c '
npm ci
Expand Down
49 changes: 49 additions & 0 deletions cases/scenarios/xstate-main-1-LSP/scenario.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "xstate-main-1-LSP",
"kind": "lsp",
"args": [],
"tsserverConfig": {
"solution": "xstate-main-1",
"commands": [
{
"commandName": "updateOpen",
"args": [
{
"file": "packages/core/src/index.ts"
},
{
"file": "packages/core/src/StateNode.ts"
}
]
},
{
"commandName": "geterr",
"args": [
"packages/core/src/StateNode.ts"
]
},
{
"commandName": "references",
"args": {
"file": "packages/core/src/index.ts",
"line": 14,
"offset": 15
}
},
{
"commandName": "navto",
"args": {
"searchValue": "State"
}
},
{
"commandName": "completionInfo",
"args": {
"file": "packages/core/src/index.ts",
"line": 47,
"offset": 1
}
}
]
}
}
10 changes: 10 additions & 0 deletions cases/scenarios/xstate-main-1-LSP/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -exo pipefail
cd "${0%/*}"

source ../../common.sh

clone_scenario https://github.com/statelyai/xstate.git 9118720b2d81cd3cd6b8e4ea8da75d576c47fa8d

run_sandboxed sh -c 'yarn install'
25 changes: 25 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading