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

perf(sql): reduce the memory overhead of sqlglot compilation [WIP] #8596

Closed
wants to merge 2 commits into from

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Mar 8, 2024

I experienced heavy memory usage during the reproduction of #8484, gigabytes of memory was used...

As turned out sqlglot expressions are aggressively deepcopied so we should minimize the amount of sqlglot expressions we hold references to. Node.map() keeps the output for each ibis expression in a mapping during translation which is not ideal in this scenario.

Luckily #7863 added a memory efficient .map_clear() alternative which was primarily used in the pandas backend, but turns out to be useful here as well.

Depends on #8592

@kszucs kszucs changed the title perf(sql): prevent sqlglot from extensive deepcopying every time we create a sqlglot object perf(sql): reduce the memory overhead of sqlglot compilation Mar 8, 2024
@kszucs kszucs changed the title perf(sql): reduce the memory overhead of sqlglot compilation perf(sql): reduce the memory overhead of sqlglot compilation [WIP] Mar 8, 2024
@kszucs
Copy link
Member Author

kszucs commented Mar 14, 2024

After the merge of 461293b this isn't significantly improving the memory usage so closing it for now.

@kszucs kszucs closed this Mar 14, 2024
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

Successfully merging this pull request may close these issues.

1 participant