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

trpc-openapi tanks our Intellisense performance by 100% #433

Open
divmgl opened this issue Jan 9, 2024 · 3 comments
Open

trpc-openapi tanks our Intellisense performance by 100% #433

divmgl opened this issue Jan 9, 2024 · 3 comments

Comments

@divmgl
Copy link

divmgl commented Jan 9, 2024

Just a heads up that in our project trpc-openapi is tanking our Intellisense performance, specifically the TypeScript Language Server. Our getCompletionData calls go from 1.1s to 2.2s (100% performance degradation) just for having the package installed in the .meta section of our tRPC app.

I apologize I don't have a base repro for you (we can't share our internal codebase). You might be able to recreate this using tRPC's BigBoi test: https://github.com/trpc/trpc/blob/1d017dd603cdf32689258baa487bc43166d9d199/packages/tests/server/react/bigBoi.test.tsx#L4

@timscullin
Copy link

Same here.
getCompletionData goes from 800ms to 1400ms when installing the package.
We have about 200 routes, it seems the more we add the slower it goes.

Best workaround for now is to uninstall trpc-openapi locally and install it during build, but not ideal.
Is there possibly a workaround to prevent it from running in our local dev environment?

@divmgl
Copy link
Author

divmgl commented Jan 30, 2024

@timscullin that's a great workaround that we didn't think of. We ended up removing trpc-openapi completely from our stack since not many endpoints were instrumented.

I think a mix of solutions is needed so that this ecosystem's TypeScript compiler performance improves which IMO is the true underlying issue. It looks like the generated and inferred types from packages used with tRPC result in types that are too complex.

@timscullin
Copy link

@divmgl yeah agree, I was thinking about that looking at some other language server performance.
This shouldn't really tank perf that bad though, as the open api endpoints don't require types as far as I am aware. Following to this ticket for updates 🙏

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