Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Reduce size of generated client #524

Closed
timsuchanek opened this issue Feb 24, 2020 · 1 comment
Closed

Reduce size of generated client #524

timsuchanek opened this issue Feb 24, 2020 · 1 comment
Assignees
Labels
kind/improvement An improvement to existing feature and code. topic: dx topic: performance

Comments

@timsuchanek
Copy link
Contributor

With a schema with 350 models and about 5000 fields, we generate a index.js of about 25mb with 100.000 lines and an index.d.ts of about 27mb with about 500.000 lines.

Just starting a simple script with JavaScript only takes 20s, that's the pure parsing and getting V8 smaller.

On top, the TypeScript compilation of a script importing @prisma/client takes 45s.

We can reduce the JavaScript runtime overhead by lazily generating the api dynamically in runtime.

The TypeScript declarations might be reduced by introducing more generics for types, which users don't import, but take a lot of space.

@timsuchanek
Copy link
Contributor Author

Done in latest alpha.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/improvement An improvement to existing feature and code. topic: dx topic: performance
Projects
None yet
Development

No branches or pull requests

3 participants