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

Generation is taking >4 minutes for a schema with 400 models #472

Open
cb-vigneshsm opened this issue Sep 30, 2024 · 2 comments
Open

Generation is taking >4 minutes for a schema with 400 models #472

cb-vigneshsm opened this issue Sep 30, 2024 · 2 comments

Comments

@cb-vigneshsm
Copy link

Describe the Bug
Generator typegraphql-prisma is taking >4 minutes compared to prisma client for a schema with >400 models while prisma client takes just under 1-2 seconds. Is this expected behaviour ?

To Reproduce
Run npx prisma generate on a schema with lot of models with below generator

generator typegraphql {
  provider           = "typegraphql-prisma"
  useOriginalMapping = "true"
}

Expected Behavior
I would expect it to be taking just a few seconds to generate everything.

Logs

prisma:GeneratorProcess prisma:getDMMF Using getDmmf Wasm +2743ms +419ms
prisma:GeneratorProcess prisma:getDMMF Using given datamodel +0ms +1ms
prisma:GeneratorProcess prisma:getDMMF dmmf data retrieved without errors in getDmmf Wasm +799ms +798ms
prisma:cli:bin Execution time for executing "await cli.parse(commandArray)": 413122.55179190636 ms +408315ms

✔ Generated Prisma Client (v5.20.0) to ./../node_modules/@prisma/client in 1.68s

✔ Generated TypeGraphQL integration to ./../node_modules/@generated/type-graphql in 409.73s

Environment (please complete the following information):

OS: Mac M3

"@prisma/client": "^5.20.0",
"prisma": "^5.20.0",
"ts-node": "^10.9.2",
"type-graphql": "^2.0.0-rc.2",
"typegraphql-prisma": "^0.28.0"

Additional Context
Saw the same issue as closed here - Issue
I have tried the steps mentioned here but have not been able to bring the time down

Appreciate any help here , thanks in advance !

@MichalLytek
Copy link
Owner

Try not to emit to node_modules but emit source code files, so it will be faster thanks to not compiling the TS code.

@cb-vigneshsm
Copy link
Author

Hey @MichalLytek , thanks for the quick response

prisma:GeneratorProcess prisma:getDMMF Using getDmmf Wasm +2938ms +452ms
prisma:GeneratorProcess prisma:getDMMF Using given datamodel +0ms +0ms
prisma:GeneratorProcess prisma:getDMMF dmmf data retrieved without errors in getDmmf Wasm +848ms +848ms
prisma:cli:bin Execution time for executing "await cli.parse(commandArray)": 354003.81416606903 ms +348891ms

✔ Generated Prisma Client (v5.20.0) to ./generated/prisma in 1.73s

✔ Generated TypeGraphQL integration to ./generated/type in 350.41s

I have set the output directory to outside node_modules, but does not seem to help

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