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

Introduce JIT code generation for performance improvement #1850

Closed
yjshen opened this issue Feb 17, 2022 · 0 comments · Fixed by #1849
Closed

Introduce JIT code generation for performance improvement #1850

yjshen opened this issue Feb 17, 2022 · 0 comments · Fixed by #1849
Labels
enhancement New feature or request

Comments

@yjshen
Copy link
Member

yjshen commented Feb 17, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
With JIT codegen, we could generate specific code for each query to reduce branching overhead from the generalized interpret mode execution. Furthermore, we could reduce the memory footprint during the execution by chaining multiple Arrow compute kernels together and reusing the intermediate vectors.

The row format we introduced lately in #1782 is another motivating use case for JIT code generation. We could eliminate most branching during row to batch or batch to row conversion since the branching pattern is set by schema, enjoy the potential advantage of several use cases for row format, and pay the least price during format conversion.

Describe the solution you'd like

  1. Create a generalized code constructing API that could fulfill our needs on expressing query-specific exec functions.
  2. Utilize Cranelift Code Generator, which is stable enough and can fulfill our use cases currently, eliminating branch and glue code fragments into runnable functions.

Describe alternatives you've considered
Build code generation runtime over LLVM instead of Cranelift. However, I think LLVM is over-killing since most of the performance-intensive computations are done at the Arrow kernel.

Additional context
We also have an item in our Roadmap: "Push-based query execution and code generation."

@yjshen yjshen added the enhancement New feature or request label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant