~/talk

Copy-and-Patch Compilation

Talkat OOPSLA 2021 · 2021-10-17..10-22· [compilers-and-language-design]
name:Haoran Xu
links:none on file
slides:none on file

Copy-and-patch compiles by copying prebuilt binary stencils into memory and patching relocations and constants at runtime, shifting heavy work to build time. A 17 MB stencil library for a C-like metaprogram generates TPC-H code two orders of magnitude faster than LLVM -O0 and three orders faster than higher optimization levels, with execution often within 24% of LLVM -O3. A WebAssembly baseline compiler uses a 35 KB library and achieves 4.9–6.5x faster compilation and 46–63% better throughput than Liftoff.

AI-written summary · about

  1. 0:00The Need For Fast Compilation
  2. 0:59Existing Approach for Tier 1: In Databases
  3. 1:42Existing Approach for Tier 1: In WebAssembly
  4. 4:29The Pareto Frontier
  5. 5:05Intuition of Copy-and-Patch
  6. 6:19Why it generates code fast?
  7. 7:19Why it generates fast code?
  8. 8:36Binary Stencils
  9. 9:29The core of the trick
  10. 9:51When we compile this code...
  11. 10:21Relocation Is Code Generation
  12. 11:27Burning in Runtime Constants?
  13. 11:48Register Allocation?
  14. 12:27Better Instruction Selection?
  15. 13:10Code Library Size
  16. 13:48How can we generate so many variants?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.