vault backup: 2024-07-02 09:32:52

This commit is contained in:
zleyyij 2024-07-02 09:32:52 -06:00
parent 8fe8a94393
commit 9f04bf4e84

View File

@ -16,7 +16,7 @@ One proposed use case of copy-and-patch compilation in the paper is as an SQL qu
> The compilation time of our compiler is so low that it is less than the time it takes to construct the AST of the program. Compared with interpreters, both have negligible startup delay (since constructing ASTs takes longer), but our execution performance is an order of magnitude faster. Compared with LLVM -O0, our implementation compiles two orders of magnitude faster and generates code that performs on average 14% better. Therefore, we conclude that copy-and-patch renders both interpreters and LLVM -O0 compilation obsolete in this use case.
# Implementation Details
At a broad level, copy and patch code compilation works by having a pre-built library of composable binary code snippets, referred to as binary stencils. This makes both code generation and optimization a simple task, achieved simply by performing a lookup in a data table to select the stencil, then copying it to the output and patching in the missing values.
At a broad level, copy and patch code compilation works by having a pre-built library of composable binary code snippets, referred to as binary stencils. Each binary stencil performs the operation of a single AST node/bytecode instruction. This makes both code generation and optimization a simple task, achieved simply by performing a lookup in a data table to select the stencil, then copying it to the output and patching in the missing values.
First, prior to compilation, MetaVar generates a stencil library.