Skip to content

[api] Reduce allocations and megamorphic object penalty from generator methods - #64888

Draft
Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:generator-api-non-breaking
Draft

Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:generator-api-non-breaking

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Doing this mostly to continue testing my benchmarking pipeline. This does help with microbenchmarks but I don't think it will show up too much on real world usage.

@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) perf test api

@typescript-automation

typescript-automation Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test api ✅ Started 👀 Results

@typescript-automation

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch)
The results of the perf run you requested are in!

Here they are:

api

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
typescript-eslint-api-floating - node (v24.21.0, x64)
API client instances 1 clients 1 clients ~ ~ ~ p=1.000 n=6
API client requests 4,935 requests 4,935 requests ~ ~ ~ p=1.000 n=6
API client round trip (sum) 686.190ms (± 2.74%) 698.766ms (± 1.80%) ~ 684.048ms 716.137ms p=0.240 n=6
API client bytes sent 386,640B 386,600B (± 0.00%) -40B (- 0.01%) 386,600B 386,601B p=0.002 n=6
API client bytes received 17,152,466B 17,152,307B (± 0.00%) -160B (- 0.00%) 17,152,306B 17,152,309B p=0.002 n=6
API client nodes materialized 425,663 nodes 425,663 nodes ~ ~ ~ p=1.000 n=6
API client source files fetched 1,029 files 1,029 files ~ ~ ~ p=1.000 n=6
API client nodes fetched 446,998 nodes 446,998 nodes ~ ~ ~ p=1.000 n=6
API server-counter requests 4,935 requests 4,935 requests ~ ~ ~ p=1.000 n=6
API server-counter processing (sum) 444.898ms (± 1.06%) 448.739ms (± 0.98%) ~ 441.027ms 454.157ms p=0.394 n=6
API client round trip minus server processing (not pure IPC) 241.291ms (± 6.37%) 250.027ms (± 4.16%) ~ 236.209ms 264.943ms p=0.394 n=6
Total time 6.8569s (± 0.31%) 6.8816s (± 0.34%) ~ 6.8466s 6.9035s p=0.132 n=6
typescript-eslint-api-recommended - node (v24.21.0, x64)
API client instances 1 clients 1 clients ~ ~ ~ p=1.000 n=6
API client requests 125,762 requests 125,762 requests ~ ~ ~ p=1.000 n=6
API client round trip (sum) 4,836.664ms (± 0.61%) 4,835.905ms (± 0.57%) ~ 4,811.387ms 4,885.291ms p=0.589 n=6
API client bytes sent 19,399,361B (± 0.00%) 19,359,519B (± 0.01%) -39,842B (- 0.21%) 19,354,331B 19,361,659B p=0.002 n=6
API client bytes received 85,114,936B (± 0.00%) 84,506,148B (± 0.03%) -608,788B (- 0.72%) 84,453,024B 84,518,603B p=0.002 n=6
API client nodes materialized 425,949 nodes 425,949 nodes ~ ~ ~ p=1.000 n=6
API client source files fetched 1,051 files 1,051 files ~ ~ ~ p=1.000 n=6
API client nodes fetched 455,120 nodes 455,120 nodes ~ ~ ~ p=1.000 n=6
API server-counter requests 125,762 requests 125,762 requests ~ ~ ~ p=1.000 n=6
API server-counter processing (sum) 2,409.342ms (± 0.63%) 2,407.492ms (± 0.45%) ~ 2,397.223ms 2,426.096ms p=0.937 n=6
API client round trip minus server processing (not pure IPC) 2,427.322ms (± 0.66%) 2,428.413ms (± 0.85%) ~ 2,404.415ms 2,459.196ms p=0.937 n=6
Total time 15.7530s (± 0.43%) 15.5716s (± 0.16%) -0.1814s (- 1.15%) 15.5237s 15.5890s p=0.002 n=6
vscode-languageserver-api-metamodel - node (v24.21.0, x64)
API client instances 1 clients 1 clients ~ ~ ~ p=1.000 n=6
API client requests 2,443 requests 2,443 requests ~ ~ ~ p=1.000 n=6
API client round trip (sum) 119.213ms (± 2.12%) 117.300ms (± 1.55%) ~ 115.115ms 120.352ms p=0.132 n=6
API client bytes sent 477,898B (± 0.00%) 477,288B (± 0.00%) -610B (- 0.13%) 477,287B 477,289B p=0.002 n=6
API client bytes received 6,265,632B (± 0.00%) 6,264,718B (± 0.00%) -914B (- 0.01%) 6,264,717B 6,264,719B p=0.002 n=6
API client nodes materialized 25,178 nodes 25,178 nodes ~ ~ ~ p=1.000 n=6
API client source files fetched 104 files 104 files ~ ~ ~ p=1.000 n=6
API client nodes fetched 81,085 nodes 81,085 nodes ~ ~ ~ p=1.000 n=6
API server-counter requests 2,443 requests 2,443 requests ~ ~ ~ p=1.000 n=6
API server-counter processing (sum) 58.299ms (± 0.87%) 58.382ms (± 1.86%) ~ 57.008ms 59.830ms p=0.937 n=6
API client round trip minus server processing (not pure IPC) 60.914ms (± 4.30%) 58.919ms (± 2.33%) ~ 56.543ms 60.522ms p=0.240 n=6
Total time 0.6631s (± 0.82%) 0.6597s (± 0.89%) ~ 0.6534s 0.6688s p=0.310 n=6
System info unknown
Hosts
  • node (v24.21.0, x64)
Scenarios
  • typescript-eslint-api-floating - node (v24.21.0, x64)
  • typescript-eslint-api-recommended - node (v24.21.0, x64)
  • vscode-languageserver-api-metamodel - node (v24.21.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@jakebailey Jake Bailey (jakebailey) added the Domain: Performance Reports of unusually slow behavior label Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team Domain: Performance Reports of unusually slow behavior For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants