Swanand

@swanandx

Compiling Rust at Scale: Lessons from Feldera

Submitted Mar 13, 2026

At Feldera, we let users write SQL to define tables and views. Under the hood, we compile that SQL into Rust code — which is then compiled with rustc to a single binary that incrementally maintains all views as new data streams into tables.

However, large enterpise client have fairly complicated SQL. e.g. ~8.5k lines of SQL code that eventually is translated to ~100k lines of Rust code by the Feldera SQL-to-Rust compiler. Which took quite long time to compile. And now imagine that for 100s of pipelines

In this talk, we’ll go over thing we did to speed up compilation time to go from over 30mins to 2 mins:

  • Eliminating monomorphization from generated code and switching to dynamic dispatch
  • Debugging why rustc was slow, even on 64 core machine, and how we overcame it by splitting it across 1000 crates
  • Trying dylibs to speed things up, and why it turned out to be a dead end in Rust
  • Bonus: what happens when your generated structs have 700 fields (spoiler: serialization gets weird)

This can help anyone who is intersted in Rust codegen or compiler toolings. Or just curious about how to tackle things at scale.

About the speaker:
Swanand Mulay, Engineer @ Feldera. Prev. Systems @ Bytebeam. Loves Rust and memes :P

ps: Previously spoke at Rust Pune meetup [ slides | LI post ]

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

A community of Rust language contributors and end-users from Bangalore. We have presence on the following telegram channels https://t.me/RustIndia https://t.me/fpncr LinkedIn: https://www.linkedin.com/company/rust-india/ more