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

Fixed braceless type tags with types starting with an open parenthesis #57167

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

Andarist
Copy link
Contributor

fixes #57166

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 25, 2024
@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@sandersn
Copy link
Member

@typescript-bot test top200
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 15, 2024

Heya @sandersn, I've started to run the regular perf test suite on this PR at 1f4862e. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 15, 2024

Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at 1f4862e. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 15, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 15, 2024

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

Update: The results are in!

@sandersn sandersn self-requested a review February 15, 2024 22:13
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 15, 2024
@sandersn
Copy link
Member

@jakebailey do you remember if jsdoc parsing shows up in perf results anymore?

Having a lot of tokens was a significant cause of slowdown in JS comment parsing when I profiled. So I don't want to add tokens unless it's for a good reason.

Is there a lot of un-braced usage of types? It's only supported in TS for compatibility, since the braces are supposed to be required.

@sandersn sandersn self-assigned this Feb 15, 2024
@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot
Copy link
Collaborator

Hey @sandersn, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the top-repos suite comparing main and refs/pull/57167/merge:

Everything looks good!

@jakebailey
Copy link
Member

@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 16, 2024

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

Update: The results are in!

@jakebailey
Copy link
Member

@jakebailey do you remember if jsdoc parsing shows up in perf results anymore?

No, not really.

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,634k (± 0.02%) 295,654k (± 0.01%) ~ 295,624k 295,682k p=0.471 n=6
Parse Time 2.65s (± 0.60%) 2.66s (± 0.34%) ~ 2.65s 2.67s p=0.142 n=6
Bind Time 0.83s (± 1.25%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=0.090 n=6
Check Time 8.25s (± 0.24%) 8.24s (± 0.34%) ~ 8.20s 8.28s p=0.519 n=6
Emit Time 7.10s (± 0.25%) 7.10s (± 0.37%) ~ 7.06s 7.13s p=0.808 n=6
Total Time 18.83s (± 0.19%) 18.82s (± 0.27%) ~ 18.75s 18.89s p=0.747 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,075k (± 1.29%) 191,612k (± 0.03%) ~ 191,554k 191,681k p=0.229 n=6
Parse Time 1.36s (± 1.28%) 1.36s (± 1.66%) ~ 1.33s 1.38s p=0.464 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.57%) ~ 0.72s 0.73s p=0.405 n=6
Check Time 9.36s (± 0.22%) 9.38s (± 0.21%) ~ 9.34s 9.39s p=0.121 n=6
Emit Time 2.62s (± 0.46%) 2.62s (± 0.52%) ~ 2.60s 2.64s p=0.410 n=6
Total Time 14.06s (± 0.18%) 14.08s (± 0.12%) ~ 14.05s 14.10s p=0.253 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,457k (± 0.01%) 347,480k (± 0.00%) ~ 347,460k 347,490k p=0.065 n=6
Parse Time 2.47s (± 0.54%) 2.48s (± 0.36%) ~ 2.47s 2.49s p=0.273 n=6
Bind Time 0.93s (± 0.81%) 0.92s (± 0.82%) ~ 0.91s 0.93s p=0.062 n=6
Check Time 6.95s (± 0.54%) 6.94s (± 0.17%) ~ 6.93s 6.96s p=0.746 n=6
Emit Time 4.05s (± 0.33%) 4.06s (± 0.40%) ~ 4.03s 4.08s p=0.440 n=6
Total Time 14.40s (± 0.27%) 14.41s (± 0.19%) ~ 14.37s 14.44s p=0.688 n=6
TFS - node (v18.15.0, x64)
Memory used 302,867k (± 0.00%) 302,864k (± 0.01%) ~ 302,841k 302,893k p=0.748 n=6
Parse Time 2.01s (± 0.66%) 2.04s (± 0.62%) +0.03s (+ 1.58%) 2.02s 2.05s p=0.009 n=6
Bind Time 1.00s (± 0.51%) 1.00s (± 0.52%) ~ 0.99s 1.00s p=0.069 n=6
Check Time 6.35s (± 0.44%) 6.35s (± 0.42%) ~ 6.30s 6.37s p=0.744 n=6
Emit Time 3.59s (± 0.70%) 3.60s (± 0.42%) ~ 3.57s 3.61s p=0.374 n=6
Total Time 12.95s (± 0.29%) 12.98s (± 0.20%) ~ 12.94s 13.02s p=0.196 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,367k (± 0.01%) 511,385k (± 0.00%) ~ 511,370k 511,404k p=0.575 n=6
Parse Time 2.66s (± 0.28%) 2.64s (± 0.44%) -0.02s (- 0.75%) 2.63s 2.66s p=0.021 n=6
Bind Time 1.00s (± 0.55%) 0.99s (± 1.18%) ~ 0.98s 1.01s p=0.152 n=6
Check Time 17.32s (± 0.58%) 17.29s (± 0.44%) ~ 17.20s 17.39s p=0.470 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.97s (± 0.44%) 20.91s (± 0.41%) ~ 20.81s 21.03s p=0.423 n=6
mui-docs - node (v18.15.0, x64)
Memory used 2,272,172k (± 0.00%) 2,272,163k (± 0.00%) ~ 2,272,135k 2,272,188k p=0.936 n=6
Parse Time 11.94s (± 0.53%) 12.00s (± 1.02%) ~ 11.90s 12.23s p=0.422 n=6
Bind Time 2.62s (± 0.29%) 2.62s (± 0.31%) ~ 2.61s 2.63s p=0.729 n=6
Check Time 102.36s (± 0.44%) 101.96s (± 0.75%) ~ 100.88s 103.28s p=0.230 n=6
Emit Time 0.32s (± 1.28%) 0.32s (± 0.00%) ~ 0.32s 0.32s p=0.405 n=6
Total Time 117.24s (± 0.40%) 116.90s (± 0.58%) ~ 116.06s 118.13s p=0.230 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,412,788k (± 0.02%) 2,412,999k (± 0.02%) ~ 2,412,341k 2,413,643k p=0.575 n=6
Parse Time 4.93s (± 1.07%) 4.94s (± 1.39%) ~ 4.85s 5.01s p=1.000 n=6
Bind Time 1.87s (± 0.79%) 1.87s (± 1.19%) ~ 1.83s 1.90s p=0.858 n=6
Check Time 33.51s (± 0.24%) 33.59s (± 0.36%) ~ 33.43s 33.73s p=0.230 n=6
Emit Time 2.67s (± 1.37%) 2.67s (± 1.60%) ~ 2.61s 2.72s p=0.809 n=6
Total Time 42.98s (± 0.27%) 43.08s (± 0.31%) ~ 42.91s 43.25s p=0.173 n=6
self-compiler - node (v18.15.0, x64)
Memory used 418,847k (± 0.01%) 418,888k (± 0.00%) +42k (+ 0.01%) 418,871k 418,904k p=0.013 n=6
Parse Time 2.81s (± 2.20%) 2.77s (± 3.33%) ~ 2.64s 2.88s p=0.462 n=6
Bind Time 1.10s (± 5.17%) 1.12s (± 6.69%) ~ 1.07s 1.23s p=0.788 n=6
Check Time 15.15s (± 0.44%) 15.15s (± 0.16%) ~ 15.11s 15.18s p=0.872 n=6
Emit Time 1.14s (± 1.08%) 1.14s (± 1.90%) ~ 1.11s 1.17s p=1.000 n=6
Total Time 20.20s (± 0.45%) 20.18s (± 0.21%) ~ 20.11s 20.23s p=0.630 n=6
vscode - node (v18.15.0, x64)
Memory used 2,844,159k (± 0.00%) 2,844,125k (± 0.00%) ~ 2,844,101k 2,844,145k p=0.173 n=6
Parse Time 10.75s (± 0.33%) 10.76s (± 0.18%) ~ 10.73s 10.79s p=0.515 n=6
Bind Time 3.43s (± 0.24%) 3.43s (± 0.37%) ~ 3.41s 3.45s p=0.673 n=6
Check Time 60.57s (± 0.51%) 60.37s (± 0.16%) ~ 60.22s 60.51s p=0.148 n=6
Emit Time 16.24s (± 0.62%) 16.19s (± 0.67%) ~ 16.05s 16.38s p=0.230 n=6
Total Time 90.98s (± 0.35%) 90.75s (± 0.22%) ~ 90.46s 91.01s p=0.230 n=6
webpack - node (v18.15.0, x64)
Memory used 394,142k (± 0.01%) 394,158k (± 0.01%) ~ 394,100k 394,235k p=0.575 n=6
Parse Time 3.12s (± 0.39%) 3.11s (± 0.32%) ~ 3.09s 3.12s p=0.303 n=6
Bind Time 1.39s (± 1.18%) 1.38s (± 1.19%) ~ 1.37s 1.41s p=0.365 n=6
Check Time 14.07s (± 0.41%) 14.08s (± 0.34%) ~ 14.03s 14.16s p=0.630 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.58s (± 0.31%) 18.57s (± 0.25%) ~ 18.54s 18.66s p=1.000 n=6
xstate - node (v18.15.0, x64)
Memory used 513,409k (± 0.02%) 513,376k (± 0.02%) ~ 513,256k 513,472k p=0.471 n=6
Parse Time 3.28s (± 0.17%) 3.27s (± 0.23%) ~ 3.26s 3.28s p=0.137 n=6
Bind Time 1.54s (± 0.34%) 1.54s (± 0.68%) ~ 1.52s 1.55s p=0.794 n=6
Check Time 2.85s (± 0.60%) 2.87s (± 0.86%) ~ 2.84s 2.90s p=0.327 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 7.90%) ~ 0.07s 0.09s p=1.000 n=6
Total Time 7.75s (± 0.31%) 7.76s (± 0.34%) ~ 7.73s 7.80s p=0.747 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@Andarist
Copy link
Contributor Author

Andarist commented Mar 3, 2024

Is there a lot of un-braced usage of types? It's only supported in TS for compatibility, since the braces are supposed to be required.

Right. But since they are optional in this context I'd expect this to work (there is an explicit boolean set here that allows it). I don't want this for myself - I'm not using JSDoc types anyway. It's just a problem I noticed when working on #57110 and such a braceless type came there (in the original issue) from the real-world code.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced that this is very valuable, but it does fix an inconsistency, and it shouldn't hurt the fast path for scanning jsdoc comment text.

@sandersn
Copy link
Member

Can you update this PR from main before I merge? There has been a lot of churn in baselines recently.

@Andarist
Copy link
Contributor Author

@sandersn done

@sandersn sandersn merged commit 9ba0800 into microsoft:main Apr 5, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Braceless JSDoc type tags fail to parse types starting with a parenthesis
4 participants