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

Speedup types with huge databases. Fixes #867 #1080

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

koskimas
Copy link
Member

@koskimas koskimas commented Jul 15, 2024

This speeds up type checks with huge database interfaces.

The added type test case took 12 seconds to check before the fixes and about 0.4 seconds after the fixes.

Once again, I have no idea why things got faster, but it's related to function overloads. Squashing all overloads of selectFrom, updateTable, mergeInto and deleteFrom into a single signature fixes the perf issues 🤷

This is a slightly breaking change. It breaks some generics use cases, but those were pretty much unusable already anyways.

@koskimas koskimas requested a review from igalklebanov July 15, 2024 15:13
Copy link

vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2024 6:03am

@koskimas koskimas force-pushed the speedup-types-with-huge-db branch from 4e6c35e to dd1c732 Compare July 15, 2024 15:19
@koskimas koskimas added breaking change Includes breaking changes typescript Related to Typescript performance issue Something is slow af labels Jul 15, 2024
src/query-creator.ts Outdated Show resolved Hide resolved
src/query-creator.ts Outdated Show resolved Hide resolved
src/query-creator.ts Outdated Show resolved Hide resolved
Copy link
Member

@igalklebanov igalklebanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 👋

LGTM! 🚀

Left a question..

Let's make sure these new types are exported @ index.ts.

@koskimas
Copy link
Member Author

Let's make sure these new types are exported

Do you mean the SelectFrom, UpdateTable etc. types? I can't see how those would be useful for the users. Did you have some use case in mind?

@igalklebanov
Copy link
Member

Let's make sure these new types are exported

Do you mean the SelectFrom, UpdateTable etc. types? I can't see how those would be useful for the users. Did you have some use case in mind?

Come to think of it, we don't need to.

@koskimas koskimas merged commit 2731f05 into v0.28 Jul 19, 2024
12 checks passed
koskimas added a commit that referenced this pull request Jul 19, 2024
@koskimas koskimas deleted the speedup-types-with-huge-db branch August 2, 2024 10:52
igalklebanov pushed a commit to igalklebanov/kysely that referenced this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Includes breaking changes performance issue Something is slow af typescript Related to Typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants