Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip parsing JSDoc when not needed #52921

Merged
merged 45 commits into from Sep 13, 2023
Merged

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Feb 22, 2023

This is #52466 plus more changes, since I think we want to try and get this in for 5.0 if possible.

Needs a test, which we can achieve thanks to the compilerOptions use here.

For #52959

jakebailey and others added 3 commits February 22, 2023 12:02
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 22, 2023
@jakebailey
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the perf test suite on this PR at 131a170. You can monitor the build here.

@jakebailey
Copy link
Member Author

This PR is still wrong, fixing but I have to run.

@jakebailey
Copy link
Member Author

@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the abridged perf test suite on this PR at 3af4435. You can monitor the build here.

Update: The results are in!

src/harness/fakesHosts.ts Outdated Show resolved Hide resolved
@jakebailey
Copy link
Member Author

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top100
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite (tsserver) on this PR at 3af4435. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 3af4435. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 3af4435. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the tarball bundle task on this PR at 3af4435. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the extended test suite on this PR at 3af4435. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite (tsserver) on this PR at 3af4435. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 22, 2023

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/147249/artifacts?artifactName=tgz&fileId=77F313F5F22E76C89FEA5F5A963AEF8EB942DE8EF20F507A82129360DDE8992502&fileName=/typescript-5.0.0-insiders.20230222.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-52921-12".;

src/compiler/scanner.ts Outdated Show resolved Hide resolved
@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..52921

Metric main 52921 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 358,876k (± 0.00%) 350,121k (± 0.01%) -8,755k (- 2.44%) 350,091k 350,151k p=0.005 n=6
Parse Time 3.72s (± 0.53%) 3.38s (± 0.85%) 🟩-0.34s (- 9.09%) 3.33s 3.41s p=0.005 n=6
Bind Time 1.19s (± 0.92%) 1.17s (± 0.47%) -0.01s (- 1.26%) 1.17s 1.18s p=0.015 n=6
Check Time 9.46s (± 0.33%) 9.38s (± 0.24%) -0.07s (- 0.76%) 9.36s 9.41s p=0.008 n=6
Emit Time 7.94s (± 0.97%) 8.17s (± 0.59%) +0.23s (+ 2.85%) 8.11s 8.24s p=0.005 n=6
Total Time 22.32s (± 0.43%) 22.12s (± 0.38%) -0.20s (- 0.90%) 21.99s 22.20s p=0.006 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,955k (± 0.71%) 189,912k (± 0.75%) -2,043k (- 1.06%) 189,271k 192,834k p=0.045 n=6
Parse Time 1.57s (± 0.87%) 1.45s (± 1.43%) 🟩-0.13s (- 8.05%) 1.41s 1.47s p=0.005 n=6
Bind Time 0.82s (± 0.50%) 0.83s (± 0.62%) +0.01s (+ 1.02%) 0.82s 0.83s p=0.022 n=6
Check Time 10.11s (± 0.27%) 9.96s (± 0.80%) -0.15s (- 1.47%) 9.91s 10.12s p=0.029 n=6
Emit Time 3.00s (± 1.01%) 3.06s (± 1.32%) +0.06s (+ 1.83%) 3.01s 3.12s p=0.030 n=6
Total Time 15.50s (± 0.34%) 15.29s (± 0.54%) -0.21s (- 1.37%) 15.20s 15.44s p=0.008 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,080k (± 0.00%) 341,785k (± 0.00%) -1,295k (- 0.38%) 341,765k 341,799k p=0.005 n=6
Parse Time 2.80s (± 0.32%) 2.73s (± 0.78%) -0.07s (- 2.56%) 2.70s 2.75s p=0.005 n=6
Bind Time 1.08s (± 0.50%) 1.09s (± 1.26%) ~ 1.08s 1.12s p=0.138 n=6
Check Time 7.70s (± 0.42%) 7.64s (± 0.51%) -0.07s (- 0.87%) 7.60s 7.70s p=0.030 n=6
Emit Time 4.44s (± 0.63%) 4.46s (± 1.13%) ~ 4.43s 4.56s p=0.570 n=6
Total Time 16.02s (± 0.32%) 15.92s (± 0.57%) ~ 15.86s 16.10s p=0.064 n=6
TFS - node (v16.17.1, x64)
Memory used 299,214k (± 0.01%) 299,300k (± 0.01%) +86k (+ 0.03%) 299,284k 299,323k p=0.005 n=6
Parse Time 2.18s (± 0.69%) 2.18s (± 0.37%) ~ 2.17s 2.19s p=0.498 n=6
Bind Time 1.23s (± 1.22%) 0.98s (± 0.64%) 🟩-0.25s (-20.54%) 0.97s 0.99s p=0.004 n=6
Check Time 7.18s (± 0.53%) 7.48s (± 0.37%) +0.30s (+ 4.18%) 7.45s 7.51s p=0.005 n=6
Emit Time 4.37s (± 0.77%) 4.33s (± 0.78%) ~ 4.28s 4.37s p=0.124 n=6
Total Time 14.96s (± 0.41%) 14.97s (± 0.21%) ~ 14.94s 15.02s p=0.936 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,754k (± 0.01%) 467,805k (± 0.01%) -7,949k (- 1.67%) 467,751k 467,847k p=0.005 n=6
Parse Time 3.33s (± 0.41%) 2.89s (± 0.72%) 🟩-0.45s (-13.45%) 2.86s 2.91s p=0.005 n=6
Bind Time 0.96s (± 0.42%) 1.11s (± 0.88%) +0.15s (+15.60%) 1.10s 1.13s p=0.003 n=6
Check Time 18.14s (± 0.83%) 18.10s (± 1.01%) ~ 17.92s 18.44s p=0.521 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.44s (± 0.61%) 22.10s (± 0.84%) -0.34s (- 1.53%) 21.93s 22.45s p=0.031 n=6
xstate - node (v16.17.1, x64)
Memory used 545,746k (± 0.02%) 518,091k (± 0.03%) 🟩-27,655k (- 5.07%) 517,983k 518,345k p=0.005 n=6
Parse Time 4.25s (± 0.33%) 3.77s (± 0.34%) 🟩-0.48s (-11.29%) 3.75s 3.78s p=0.005 n=6
Bind Time 1.74s (± 0.43%) 1.66s (± 0.45%) 🟩-0.08s (- 4.78%) 1.65s 1.67s p=0.004 n=6
Check Time 3.00s (± 0.54%) 3.19s (± 0.26%) +0.20s (+ 6.62%) 3.18s 3.20s p=0.004 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.08s (± 0.31%) 8.71s (± 0.20%) 🟩-0.37s (- 4.02%) 8.69s 8.74s p=0.005 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52921 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/52921/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.json

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/52921/merge:

Something interesting changed - please have a look.

Details

webpack

⚠️ Note that built had errors ⚠️
Req #2032 - completionEntryDetails
    at Object.getImportCompletionAction (/typescript-main/built/local/tsserver.js:141638:11)
    at getCompletionEntryCodeActionsAndSourceDisplay (/typescript-main/built/local/tsserver.js:149781:62)
    at Object.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:149666:46)
    at Object.getCompletionEntryDetails2 [as getCompletionEntryDetails] (/typescript-main/built/local/tsserver.js:135555:35)
    at /typescript-main/built/local/tsserver.js:179168:43
    at mapDefined (/typescript-main/built/local/tsserver.js:2627:22)
    at IOSession.getCompletionEntryDetails (/typescript-main/built/local/tsserver.js:179166:20)
    at completionEntryDetails (/typescript-main/built/local/tsserver.js:177512:43)
    at /typescript-main/built/local/tsserver.js:179856:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:179848:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:179856:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:179898:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:181442:14)

🎉 New server no longer has errors 🎉

@jakebailey
Copy link
Member Author

Um, hm. Those errors are interesting because they imply that I'm still doing something wrong here.

src/compiler/watchPublic.ts Outdated Show resolved Hide resolved
src/compiler/parser.ts Outdated Show resolved Hide resolved
@jakebailey
Copy link
Member Author

jakebailey commented Sep 13, 2023

@fisker @sosukesuzuki you might be interested in this one. I'm not sure if prettier or typescript-estree actually use the .jsdoc properties / JSDoc nodes, but if they don't, then this should result in a significant speedup on files that contain JSDoc so long as this new parser option is plumbed.

Actually, thinking about it, external users may not even need @see or @link; would it make sense to modify this API such that it's possible to say "I don't care about JSDoc at all" and just enable semantic JSDoc tags inside of tsc?

(It's kinda now or never, given the PR currently has a boolean which explicitly calls out semantic JSDoc tags.)

@jakebailey jakebailey changed the title Skip parsing JSDoc in .ts files Skip parsing JSDoc in .ts files when not needed by caller Sep 13, 2023
@jakebailey
Copy link
Member Author

In fact, one may not even need the tags at all even outside of TS files, e.g. formatting JS files...

@jakebailey jakebailey changed the title Skip parsing JSDoc in .ts files when not needed by caller Skip parsing JSDoc when not needed Sep 13, 2023
@jakebailey
Copy link
Member Author

jakebailey commented Sep 13, 2023

Actually to start, I'm just going to make this API internal as-is (because we want this in tsc now), and then send a follow-up change for comment to make this more configurable.

@jakebailey
Copy link
Member Author

@typescript-bot perf test this faster
@typescript-bot perf test this bun

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 13, 2023

Heya @jakebailey, I've started to run the tsc-only perf test suite on this PR at b287a9f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 13, 2023

Heya @jakebailey, I've started to run the bun perf test suite on this PR at b287a9f. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 300,543k (± 0.01%) 294,074k (± 0.01%) -6,469k (- 2.15%) 294,052k 294,101k p=0.005 n=6
Parse Time 3.01s (± 0.18%) 2.83s (± 0.14%) 🟩-0.18s (- 5.88%) 2.82s 2.83s p=0.003 n=6
Bind Time 0.93s (± 0.00%) 0.92s (± 0.60%) -0.02s (- 1.61%) 0.91s 0.92s p=0.002 n=6
Check Time 9.35s (± 0.21%) 9.27s (± 0.38%) -0.09s (- 0.93%) 9.21s 9.30s p=0.005 n=6
Emit Time 7.63s (± 0.30%) 7.44s (± 0.29%) -0.19s (- 2.53%) 7.41s 7.47s p=0.005 n=6
Total Time 20.92s (± 0.18%) 20.44s (± 0.22%) -0.48s (- 2.29%) 20.38s 20.50s p=0.005 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 194,625k (± 0.53%) 192,285k (± 0.02%) -2,341k (- 1.20%) 192,231k 192,315k p=0.005 n=6
Parse Time 1.58s (± 0.00%) 1.46s (± 0.00%) 🟩-0.12s (- 7.59%) 1.46s 1.46s p=0.001 n=6
Bind Time 0.79s (± 0.65%) 0.79s (± 0.00%) ~ 0.79s 0.79s p=0.174 n=6
Check Time 9.95s (± 0.35%) 9.88s (± 0.39%) -0.07s (- 0.70%) 9.80s 9.90s p=0.007 n=6
Emit Time 2.74s (± 0.19%) 2.75s (± 0.37%) +0.02s (+ 0.61%) 2.74s 2.77s p=0.009 n=6
Total Time 15.06s (± 0.22%) 14.89s (± 0.33%) -0.17s (- 1.16%) 14.79s 14.92s p=0.005 n=6
Monaco - node (v16.17.1, x64)
Memory used 347,291k (± 0.01%) 346,369k (± 0.00%) -922k (- 0.27%) 346,353k 346,375k p=0.005 n=6
Parse Time 2.69s (± 0.15%) 2.64s (± 0.39%) -0.04s (- 1.67%) 2.63s 2.66s p=0.003 n=6
Bind Time 0.99s (± 0.00%) 0.99s (± 0.00%) ~ 0.99s 0.99s p=1.000 n=6
Check Time 7.96s (± 0.23%) 7.89s (± 0.28%) -0.08s (- 0.96%) 7.86s 7.92s p=0.005 n=6
Emit Time 4.25s (± 0.25%) 4.27s (± 0.28%) ~ 4.25s 4.28s p=0.138 n=6
Total Time 15.90s (± 0.17%) 15.79s (± 0.19%) -0.11s (- 0.66%) 15.74s 15.82s p=0.005 n=6
TFS - node (v16.17.1, x64)
Memory used 301,404k (± 0.01%) 301,621k (± 0.00%) +217k (+ 0.07%) 301,614k 301,626k p=0.005 n=6
Parse Time 2.17s (± 0.82%) 2.16s (± 1.12%) ~ 2.13s 2.20s p=0.220 n=6
Bind Time 1.12s (± 1.35%) 0.90s (± 0.57%) 🟩-0.21s (-19.10%) 0.90s 0.91s p=0.004 n=6
Check Time 7.23s (± 0.33%) 7.45s (± 0.28%) +0.22s (+ 3.09%) 7.43s 7.48s p=0.005 n=6
Emit Time 3.98s (± 0.26%) 3.96s (± 0.14%) -0.02s (- 0.46%) 3.96s 3.97s p=0.008 n=6
Total Time 14.50s (± 0.27%) 14.47s (± 0.15%) ~ 14.45s 14.50s p=0.294 n=6
material-ui - node (v16.17.1, x64)
Memory used 479,884k (± 0.00%) 469,676k (± 0.01%) -10,208k (- 2.13%) 469,560k 469,737k p=0.005 n=6
Parse Time 3.15s (± 0.20%) 2.76s (± 0.15%) 🟩-0.39s (-12.33%) 2.76s 2.77s p=0.003 n=6
Bind Time 0.91s (± 0.00%) 1.05s (± 0.49%) +0.14s (+15.75%) 1.05s 1.06s p=0.002 n=6
Check Time 17.85s (± 0.35%) 17.80s (± 0.25%) ~ 17.76s 17.87s p=0.128 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.90s (± 0.27%) 21.61s (± 0.24%) -0.29s (- 1.32%) 21.57s 21.70s p=0.005 n=6
xstate - node (v16.17.1, x64)
Memory used 542,865k (± 0.01%) 509,327k (± 0.02%) 🟩-33,538k (- 6.18%) 509,239k 509,478k p=0.005 n=6
Parse Time 3.69s (± 0.23%) 3.39s (± 0.15%) 🟩-0.29s (- 7.91%) 3.39s 3.40s p=0.004 n=6
Bind Time 1.46s (± 0.28%) 1.64s (± 0.00%) +0.18s (+12.20%) 1.64s 1.64s p=0.002 n=6
Check Time 3.17s (± 0.37%) 3.14s (± 0.52%) -0.02s (- 0.74%) 3.13s 3.17s p=0.035 n=6
Emit Time 0.08s (± 6.19%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=0.174 n=6
Total Time 8.39s (± 0.14%) 8.27s (± 0.20%) -0.12s (- 1.47%) 8.25s 8.29s p=0.005 n=6
System info unknown
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - bun (v1.0.0, x64)
Memory used 321,868k (± 0.11%) 316,799k (± 0.17%) -5,069k (- 1.57%) 315,340k 318,366k p=0.000 n=12
Parse Time 2.34s (± 0.52%) 2.30s (± 0.39%) -0.03s (- 1.39%) 2.28s 2.33s p=0.000 n=12
Bind Time 0.91s (± 1.59%) 0.90s (± 2.18%) ~ 0.83s 0.95s p=0.747 n=12
Check Time 8.09s (± 0.50%) 7.96s (± 0.34%) -0.13s (- 1.62%) 7.89s 8.04s p=0.000 n=12
Emit Time 6.42s (± 0.52%) 6.40s (± 0.28%) ~ 6.36s 6.47s p=0.295 n=12
Total Time 17.76s (± 0.28%) 17.57s (± 0.26%) -0.19s (- 1.08%) 17.49s 17.73s p=0.000 n=12
Compiler-Unions - bun (v1.0.0, x64)
Memory used 255,023k (± 0.31%) 245,488k (± 1.01%) 🟩-9,535k (- 3.74%) 236,221k 248,298k p=0.000 n=12
Parse Time 1.25s (± 0.40%) 1.13s (± 1.31%) 🟩-0.13s (-10.16%) 1.11s 1.19s p=0.000 n=12
Bind Time 0.84s (± 1.17%) 0.83s (± 0.96%) ~ 0.81s 0.85s p=0.082 n=12
Check Time 8.92s (± 0.44%) 8.79s (± 0.33%) -0.13s (- 1.46%) 8.72s 8.89s p=0.000 n=12
Emit Time 2.81s (± 0.55%) 2.79s (± 0.79%) ~ 2.75s 2.87s p=0.307 n=12
Total Time 13.82s (± 0.31%) 13.55s (± 0.29%) -0.27s (- 1.99%) 13.46s 13.63s p=0.000 n=12
Monaco - bun (v1.0.0, x64)
Memory used 369,676k (± 0.09%) 378,830k (± 0.18%) +9,153k (+ 2.48%) 376,910k 379,942k p=0.000 n=12
Parse Time 2.04s (± 0.20%) 1.98s (± 0.77%) 🟩-0.06s (- 3.14%) 1.95s 2.02s p=0.000 n=12
Bind Time 1.10s (± 0.98%) 0.96s (± 2.05%) 🟩-0.14s (-12.50%) 0.90s 1.01s p=0.000 n=12
Check Time 7.20s (± 0.25%) 7.39s (± 0.32%) +0.19s (+ 2.66%) 7.31s 7.43s p=0.000 n=12
Emit Time 3.73s (± 0.50%) 3.73s (± 0.49%) ~ 3.69s 3.78s p=0.953 n=12
Total Time 14.07s (± 0.20%) 14.06s (± 0.22%) ~ 13.97s 14.13s p=0.562 n=12
TFS - bun (v1.0.0, x64)
Memory used 317,716k (± 0.19%) 317,316k (± 0.18%) ~ 315,395k 318,424k p=0.470 n=12
Parse Time 1.79s (± 0.45%) 1.76s (± 0.85%) -0.03s (- 1.63%) 1.73s 1.81s p=0.004 n=12
Bind Time 0.99s (± 2.03%) 1.00s (± 1.15%) ~ 0.98s 1.03s p=0.229 n=12
Check Time 6.62s (± 0.37%) 6.60s (± 0.27%) ~ 6.55s 6.65s p=0.338 n=12
Emit Time 3.45s (± 0.52%) 3.46s (± 0.67%) ~ 3.41s 3.54s p=0.384 n=12
Total Time 12.85s (± 0.30%) 12.83s (± 0.26%) ~ 12.75s 12.91s p=0.524 n=12
material-ui - bun (v1.0.0, x64)
Memory used 531,912k (± 0.36%) 492,259k (± 2.05%) 🟩-39,653k (- 7.45%) 475,278k 511,028k p=0.000 n=12
Parse Time 2.49s (± 0.44%) 2.24s (± 0.24%) 🟩-0.25s (-10.17%) 2.23s 2.25s p=0.000 n=12
Bind Time 0.71s (± 0.59%) 0.74s (± 3.20%) ~ 0.69s 0.79s p=0.402 n=12
Check Time 15.86s (± 0.35%) 15.76s (± 0.38%) -0.10s (- 0.63%) 15.57s 15.89s p=0.026 n=12
Emit Time 0.00s (±217.90%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=0.359 n=12
Total Time 19.07s (± 0.30%) 18.75s (± 0.29%) -0.33s (- 1.72%) 18.58s 18.90s p=0.000 n=12
xstate - bun (v1.0.0, x64)
Memory used 489,211k (± 4.78%) 410,056k (± 5.97%) 🟩-79,155k (-16.18%) 380,851k 464,238k p=0.001 n=12
Parse Time 3.61s (± 0.47%) 3.25s (± 0.26%) 🟩-0.36s (-10.08%) 3.24s 3.28s p=0.000 n=12
Bind Time 1.39s (± 0.81%) 1.26s (± 0.86%) 🟩-0.13s (- 9.24%) 1.22s 1.28s p=0.000 n=12
Check Time 3.57s (± 0.54%) 3.59s (± 0.20%) ~ 3.57s 3.61s p=0.066 n=12
Emit Time 0.22s (± 5.59%) 0.21s (± 2.29%) 🟩-0.01s (- 5.68%) 0.20s 0.22s p=0.044 n=12
Total Time 8.79s (± 0.22%) 8.32s (± 0.23%) 🟩-0.48s (- 5.43%) 8.26s 8.37s p=0.000 n=12
System info unknown
Hosts
  • bun (v1.0.0, x64)
Scenarios
  • Angular - bun (v1.0.0, x64)
  • Compiler-Unions - bun (v1.0.0, x64)
  • Monaco - bun (v1.0.0, x64)
  • TFS - bun (v1.0.0, x64)
  • material-ui - bun (v1.0.0, x64)
  • xstate - bun (v1.0.0, x64)
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - bun (v1.0.0, x64)
Execution time 428.94ms (± 0.09%) 428.70ms (± 0.08%) -0.24ms (- 0.06%) 427.55ms 436.45ms p=0.000 n=600
tsserverlibrary-startup - bun (v1.0.0, x64)
Execution time 666.67ms (± 0.14%) 665.13ms (± 0.15%) -1.54ms (- 0.23%) 663.29ms 683.23ms p=0.000 n=600
typescript-startup - bun (v1.0.0, x64)
Execution time 667.75ms (± 0.13%) 665.86ms (± 0.12%) -1.88ms (- 0.28%) 664.00ms 679.75ms p=0.000 n=600
System info unknown
Hosts
  • bun (v1.0.0, x64)
Scenarios
  • tsc-startup - bun (v1.0.0, x64)
  • tsserverlibrary-startup - bun (v1.0.0, x64)
  • typescript-startup - bun (v1.0.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@jakebailey jakebailey merged commit c0b39c6 into microsoft:main Sep 13, 2023
19 checks passed
@jakebailey jakebailey deleted the skip-jsdoc branch September 13, 2023 22:58
@jakebailey
Copy link
Member Author

Follow-up is #55739.

@bradzacher
Copy link
Contributor

would it make sense to modify this API such that it's possible to say "I don't care about JSDoc at all"

Yes. TS-ESTree does not use the JSDoc property at all - we do absolutely no touching of JSDoc. We do touch the comment contents so we can transform the AST node, but that is just via the source code text.

I don't believe any part of our ecosystem touches JSDoc - as we've seen even the JSDoc plugin doesn't as it uses its own separate JSDoc parser.

We'd see pretty decent wins across the ecosystem by being able to completely skip the JSDoc parsing!

@jakebailey
Copy link
Member Author

I think my main concern is that people will want to read out the .jsDoc properties by asking typescript-eslint for the original AST nodes (e.g. #55139), and then find that the info was never populated, or similar. I also wanted to try and make .jsDoc lazy and only create it when accessed (since we have the text anyway), but since JSDoc is bound by the binder, you can't really do that.

But #55739 is probably a better place to keep talking about the bulk hammer of letting people disable it.

@fisker
Copy link

fisker commented Sep 14, 2023

I'm not sure if prettier or typescript-estree actually use the .jsdoc properties / JSDoc nodes

Prettier uses the AST provied by @typescript-eslint/parser, since bradzacher already answered that TS-ESTree does not use the JSDoc property at all, so Prettier doesn't need it either.

snovader pushed a commit to mestro-se/TypeScript that referenced this pull request Sep 23, 2023
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants