drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

Optimize Drizzle validator types

Open L-Mario564 opened this issue 8 months ago • 0 comments

This PR aims to improve TS language server performance for drizzle-zod, drizzle-valibot, drizzle-typebox and drizzle-arktype.

I used drizzle-arktype as the base for the optimization, getting around 20%-30% less type instantiations compared to before. There are some types that could be removed and have its logic placed in the types that use it, but I personally thought it hurts readability and removing such types only improves around 1%-2% (I did some testing/benchmarking), not too worth it IMO.

Other validator packages should have way less type instantions as well as removing some redudancy in some types, except for some types in drizzle-valibot since Valibot has more complex types, but it should see significant improvements too.

While I was doing this, I also fixed #4383 for drizzle-arktype.

L-Mario564 avatar Apr 17 '25 16:04 L-Mario564