-
Notifications
You must be signed in to change notification settings - Fork 66
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
Excessive build times and memory consumption transpiling edgeql-js #1046
Comments
TypeScript 5.3 introduced a pretty big performance regression in our types, specifically the Stay tuned for the next release out in the next week or so, and I'll leave this issue open if you want to check back in after that release and we can explore any specific issues you still have. |
Just saw your minimal repro, and here's what I get (257M memory usage and 483k Instantiations):
I know your example is very small, but this isn't a really egregious example. I'll send an update with more. One of the main issues here is that you pay for all of the overhead of the complex inference engine even if you only use small parts of it. Granted, it gets a lot worse if you do use more complicated parts of it, but this is to be expected. Here's a similarally minimal case for drizzle-orm with better-sqlite3:
Now granted that example includes checking libraries, but that's a little closer to a one-to-one comparison with how our query builder codegen works. With
I'm toying with the idea of having the query builder built as more of a library to capitalize on these kinds of gains, but haven't spent enough time exploring it just yet. I know Prisma does something similar where it generates into your At any rate, regardless of whatever kinds of project-level mitigations we can suggest for users, my plan is definitely to continue to measure and improve inference performance and DX. |
I'm surprised that you got those results running
|
Did you see the PR I made to show off the project references setup? The |
Oh, I see you already merged that! I think the main issue with your results are not running in "build mode" which is the way you're supposed to use project references (see https://www.typescriptlang.org/docs/handbook/project-references.html for more details). If you don't run it in build mode, you are correct, it's even worse! |
Same issue for me with NestJS. I can't run my project anymore in dev or build mode, bacause the compilation always results in "Reached heap limit Allocation failed - JavaScript heap out of memory" The compilation of edgeql-js wants 4GB+ Very frustrating. |
@rtlayzell Do you have any solutions for that? Maybe also a problem with NestJS? |
Have you tried setting up Project References for the query builder yet? |
I'm using the edgedb-js query builder alongside a nestjs project and ran into some out of memory issues when building or starting the app. I've tracked the issue down to transpiling the generated edgeql-js, during transpilation build times seem to be excessive and memory consumption reaches 4GB+.
I've created a sample project that minimally reproduces the issue.
I could probably pre-build the generated edgeql-js somehow but it's not ideal, and while the issue persists the query builder is pretty much a non-starter for any real projects.
Versions:
2.0
): 5.4+867a5052.0
): 5.1.0+fdf5320edgedb-js
version (e.g.0.20.10
;): @1.5.7@edgedb/generate
version (e.g.0.0.7
;): v0.5.3The text was updated successfully, but these errors were encountered: