-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
[BUG]: Extremely slow intellisense depending on schema size and amount #800
Comments
+1 VSCode gets bogged down and often I have to restart the extension host to get it to load the types |
+1 With 32 tables and more or less 30 columns per table it takes 14s to fire intellisense, when it used to take 2-3 seconds without drizzle, I measured it using Using the trick of casting the column names as string (ex.: |
Related issue: #437 |
Update from the Drizzle team: Tweet |
Nice, the column name Regex find and replace |
This actually does help! The issue is that drizzle orm is generating a lot of types by inferring things and most of that inferring depends on the column names. So if we add export const ticket = pgTable(
'ticket',
{
id: uuid('id' as string).primaryKey().notNull(),
}); I ended up using |
Any updates? This is very annoying tbh. |
Seems like it'll be released sometime in August according to this thread on Discord |
Thanks for letting me know 👍🏼 |
FYI I just merged a perf fix in TS (microsoft/TypeScript#55224) which mitigates at least half of the slowness in microsoft/TypeScript#54939 / #870. I'm not sure how much it'll help other projects in general without having them to test, but feel free to try the build in microsoft/TypeScript#55224 (comment) or wait for the next nightly build to see how much it helps. As with all things perf, it's never just one thing 😄 |
We've released We've run the diagnostics on a database schema with 85 tables, 666 columns, 26 enums, 172 indexes, and 133 foreign keys. We've optimized internal types which resulted in 430% speed up in IntelliSense. https://github.com/drizzle-team/drizzle-orm/releases/tag/0.28.0 |
Is anyone still having this issue? I am using Webstorm on m1 macbook pro, with about 10 tables with 15 cols each. 😢 |
@jacobhjkim I haven't had this issue since they pushed the fix last year. Intellisense has been running decently fast, even though my schema has grown a lot bigger |
Ok, so intellisense seems to working fine on my VS Code. So it's probably something to do with Webstorm. I will test more and report back. |
Intellisense working on VS Code, but don't work on Webstorm. MBP m1. It is problem for me, because I can't working with VS Code |
What version of
drizzle-orm
are you using?0.27.0
What version of
drizzle-kit
are you using?0.19.1
Describe the Bug
Intellisense gets unusably slow when providing the schema in the
drizzle(sql, { schema })
instantiation.The intellisense delay depends on the schema amount size, it approaches 8 seconds for us on a Macbook Pro M2 Max with 40 tables, with other, non Macbook M processor people are reporting 10-15 second delays.
It gets faster again when we only provide a subset of the schemas.
Expected behavior
Instant/fast intellisense.
I suppose the TS types are calculated on the go when intellisense activates? This might be the bottleneck. Other libraries generate types and store them on the filesystem. Is this an option for Drizzle?
Environment & setup
Macbook Pro M2 Max
The text was updated successfully, but these errors were encountered: