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

Performance: Prisma generate freezes with large schema with dbml generator #38

Open
marcjulian opened this issue Jul 18, 2022 · 5 comments

Comments

@marcjulian
Copy link
Member

image
there seems to be another issue that isn't caught by the tests, because when generating in a reasonably sized project it's frozen, when removing the dbml generator provider it does generate correctly

Originally posted by @PabloSzx in #37 (comment)

@marcjulian
Copy link
Member Author

marcjulian commented Jul 18, 2022

@PabloSzx let's track the performance issue here. We should setup a large dummy/test schema to find out the bottleneck of this generator. How large (lines of code) is the prisma.schema where it froze?

@PabloSzx
Copy link
Contributor

Is ~650 lines

@yourbuddyconner
Copy link

Think I have another instance of this, my schema is ~400 lines long, with many enums peppered all over which I think is affecting graph complexity.

@marcjulian
Copy link
Member Author

@yourbuddyconner is it freezing or just taking for a long time to generate?
Are thus enums with a few or a lot of entries?

I guess will need to create a test schema with lots of entries, relationships and enums to test it out.

@yourbuddyconner
Copy link

yourbuddyconner commented Jan 13, 2023

I feel like it was hanging, I profiled the process and it wasn't using a considerable amount of CPU or memory, so my conclusion was a weird hang of some kind but that wasn't based on a deep dive or anything.

I am using a schema generated by Prisma, which includes an average of ~1 enum across 20+ models with a web of relations across them. The enums have <10 options, averaging 2-4, and idk if that affects performance at all.

Anecdotally, I have been having difficulty generating ERDs with this schema across a variety of tools, with the only reliable one being PGAdmin. Prisma might be using some fancy Postgres stuff that is specific to a newer version of PSQL.

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

3 participants