Skip to content

optimize typescript compiler performance #9471

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

Closed
wants to merge 1 commit into from

Conversation

beerose
Copy link
Contributor

@beerose beerose commented Feb 27, 2023

Description

This PR makes TypeScript compiler over 3x faster:

BEFORE:
CleanShot 2023-02-27 at 14 05 48@2x

AFTER:
CleanShot 2023-02-27 at 14 03 18@2x

Long story short, I was looking at some bigger TypeScript repos to play a bit with optimizing TS performance. I generated a trace for the console and found that react-hook-form is quite slow (the Controller components turned out to be a bottleneck), so I first tried to fix that, but then found this issue: microsoft/TypeScript#46948, and I upgraded TS to see if that helps. Turns out it does! 🔥

I also updated the code in a few places to make it work with the newest TS.

Changelog

N/A

Steps to test and verify

Run extended diagnostics to see the improvement.

Limitations, known bugs & workarounds

You could think about excluding Storybook's stories from the ts build (add it to tsconfig and possibly create a separate config for Storybook?). That would improve the time even more.

@beerose beerose requested a review from a team as a code owner February 27, 2023 13:15
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @beerose, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible.

Stay awesome! 😎

@manasag
Copy link
Contributor

manasag commented Feb 27, 2023

Hi @beerose, thanks for opening this pull request. Please note that all the Console related code has been migrated to a new folder called frontend and uses NX based build system. Please refer to Readme in that folder on new steps to build Console locally. You probably need to rework this PR for the new system. Feel free to drop in your questions if you are facing issues with this. cc @beaussan

@beaussan
Copy link
Contributor

Hey @beerose !

Nice to see you here =)

We migrated the console to Nx and we need to update the readme of the /console to inform contributors this, sorry for this !

You can find the new workspace at /frontend (with documentation here about the before / after files locations).

I was working today on a ts & dependancies updates, thanks for your findings ! I'll bump it to 4.9.5 (it was 4.8.4 in my PR).

You could think about excluding Storybook's stories from the ts build (add it to tsconfig and possibly create a separate config for Storybook?). That would improve the time even more.

This is something we are doing in the new workspace (tsConfig of storybook, vs the one of the lib) ! It indeed improve the speed !

@beerose
Copy link
Contributor Author

beerose commented Feb 27, 2023

Oh well, unnecessary PR then 😅 Closing it

@beerose beerose closed this Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants