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

The tsc memory usage problem #861

Open
ShookLyngs opened this issue Apr 3, 2023 · 2 comments
Open

The tsc memory usage problem #861

ShookLyngs opened this issue Apr 3, 2023 · 2 comments

Comments

@ShookLyngs
Copy link
Contributor

I have an existing vite project with @ricons/material and @ricons/antd as devDependencies, and when I ran tsc --diagnostics command , here's the result:

Files:             12372
Lines:            218414
Identifiers:      345716
Symbols:          198770
Types:             16247
Instantiations:    79425
Memory used:    2166158K
I/O read:          0.55s
I/O write:         0.00s
Parse time:        3.74s
Bind time:         1.08s
Check time:        1.10s
Emit time:         0.00s
Total time:        5.91s

Then I added the @ricons/fluent to devDependencies, imported an icon from the library, and then re-ran the command again, here's the result:

Files:             22443
Lines:            268767
Identifiers:      486698
Symbols:          249123
Types:             16248
Instantiations:    79425
Memory used:    3877564K
I/O read:          1.91s
I/O write:         0.00s
Parse time:       10.67s
Bind time:         3.06s
Check time:        4.51s
Emit time:         0.00s
Total time:       18.25s

We can see that with the new icon package added to the devDependencies, the tsc program had to use much more memory than before. How can we resolve it?

@ShookLyngs
Copy link
Contributor Author

@07akioni After changing all import { A } from '@ricons/xx' to import A from '@ricons/xx/A', the tsc memory used is now normal, but how can I shrink the process and make it simpler? Do you think you can provide a vite plugin to do the job?

@kamatil-dev
Copy link

@07akioni

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

No branches or pull requests

2 participants