Skip to content

Conversation

@Virgiel
Copy link
Member

@Virgiel Virgiel commented May 24, 2023

When benchmarking codegen, I found that we spent most of our time communicating with the database synchronously to prepare each query one by one. By using an asynchronous client and relying on pipelining, codegen's time went from 22ms to 6ms on my machine.

@Virgiel
Copy link
Member Author

Virgiel commented May 25, 2023

When we generate code against a managed database, most of our time is spent on docker commands, 1.3s when managed vs 50ms when live. We don't have an easy way to improve this.

Parsing is also an expensive CPU task that we can parallelize by module, but the gain is less: 6ms down to 4ms. Finally, we could also use mmap instead of reading queries and schema files into memory for even smaller but easy gain.

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