Kobzol 6/21/2026

Optimizing #[sqlx::test] rebuild time

Read Original

This article discusses the problem of slow incremental rebuild times (~8-10s) for Rust tests using the #[sqlx::test] attribute, specifically in the bors merge queue bot project. The author profiles the build time and identifies several factors: debug info generation, incremental session loading, linker speed, and sqlx test compilation. The focus is on sqlx test compilation, which remains slow even with SQLX_OFFLINE=1 and opt-level=3 for sqlx-macros. The author explains how #[sqlx::test] works, including database creation, migration loading from disk, and parsing, and begins to analyze why compilation is slow despite offline mode.

Optimizing #[sqlx::test] rebuild time

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet