<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jerome Etienne</title>
    <description>The latest articles on DEV Community by Jerome Etienne (@jeromeetienne).</description>
    <link>https://dev.to/jeromeetienne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F40864%2Fe14e97db-46b2-4479-a4f9-f11c82ffa8ea.jpeg</url>
      <title>DEV Community: Jerome Etienne</title>
      <link>https://dev.to/jeromeetienne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeromeetienne"/>
    <language>en</language>
    <item>
      <title>Making Rust Development with AI Faster</title>
      <dc:creator>Jerome Etienne</dc:creator>
      <pubDate>Tue, 17 Nov 2026 11:11:12 +0000</pubDate>
      <link>https://dev.to/jeromeetienne/making-rust-development-with-ai-faster-23p6</link>
      <guid>https://dev.to/jeromeetienne/making-rust-development-with-ai-faster-23p6</guid>
      <description>&lt;p&gt;&lt;em&gt;With AI, each coding task gets its own worktree. Here’s how to create and build your rust worktrees more than 10 times faster.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Parallel coding agents multiply the same Rust build cost
&lt;/h2&gt;

&lt;p&gt;I use a separate branch and worktree for each coding task. With three coding agents, a bug fix, a feature, and a test update can all move forward at once. Builds and tests run independently, and I review the changes before merging.&lt;/p&gt;

&lt;p&gt;This is the &lt;a href="https://docs.github.com/en/get-started/using-github/github-flow" rel="noopener noreferrer"&gt;feature&lt;/a&gt; &lt;a href="https://about.gitlab.com/topics/version-control/what-is-gitlab-flow/" rel="noopener noreferrer"&gt;branch&lt;/a&gt; &lt;a href="https://nvie.com/posts/a-successful-git-branching-model/" rel="noopener noreferrer"&gt;workflow&lt;/a&gt;, extended with Git worktrees so several branches can be checked out at once. Separate working directories prevent edits for one task from disrupting a build for another.&lt;/p&gt;

&lt;p&gt;The annoying part comes before any code changes. A fresh Rust worktree usually has an empty Cargo build folder, so the dependencies already compiled in the main checkout get compiled again. And again for the next task.&lt;/p&gt;

&lt;p&gt;For &lt;a href="https://github.com/mpiorowski/late-sh" rel="noopener noreferrer"&gt;late-sh&lt;/a&gt;, a program I contributed to recently, the benchmark scaled to three worktrees gives &lt;strong&gt;6 minutes 36 seconds ordinarily, compared with 16 seconds using Faster Rust Work Trees&lt;/strong&gt; for creation and first release builds: approximately &lt;strong&gt;24 times faster&lt;/strong&gt;. &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/blob/main/README.md" rel="noopener noreferrer"&gt;Details here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Additional allocated space for those three worktrees falls from &lt;strong&gt;10.5 GB to 254 MB&lt;/strong&gt;, saving about &lt;strong&gt;10.2 GB&lt;/strong&gt;, with &lt;strong&gt;41 times less&lt;/strong&gt; new allocation. Reusing compiled output can also reduce unnecessary writes and help extend drive lifetime. The lifetime gain depends on actual writes and other drive activity; disk allocation alone doesn’t measure wear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reuse an existing build while keeping worktrees independent
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees" rel="noopener noreferrer"&gt;Faster Rust Work Trees&lt;/a&gt; gives each new worktree a copy of the main checkout’s Cargo output using &lt;strong&gt;copy-on-write cloning&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The file system initially stores unchanged contents in shared disk blocks. Each worktree still has its own files. Writing new data allocates separate blocks for the changes, leaving the other worktrees’ contents untouched.&lt;/p&gt;

&lt;p&gt;That independence matters. A common build folder makes several coding agents write to the same output and potentially wait on each other. With cloned build folders, compilation for one task can replace output without affecting another task.&lt;/p&gt;

&lt;p&gt;Sharing blocks saves disk space; reusing compiled output saves build time. But Cargo must still recognise the existing build as current.&lt;/p&gt;

&lt;p&gt;The mechanism originated in &lt;a href="https://github.com/heidrun-org/heidrun_code/tree/main/packages/dev_tools/worktree_tools" rel="noopener noreferrer"&gt;Heidrun Code&lt;/a&gt;. Faster Rust Work Trees packages the same approach with a skill that guides your coding agent through repository setup and verification.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why cloning the build folder alone does not work
&lt;/h2&gt;

&lt;p&gt;Copying the build folder is only part of the work. Fresh source timestamps and paths pointing to the original checkout can still cause Cargo to rebuild.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preserve exact dates for unchanged sources
&lt;/h3&gt;

&lt;p&gt;Git gives newly checked-out source files fresh modification timestamps. Cargo uses timestamps when deciding whether to rebuild, so identical source code can look newer than the existing output and trigger compilation.&lt;/p&gt;

&lt;p&gt;Faster Rust Work Trees restores the original timestamps only after checking that tracked regular files have identical contents. Changed files keep their new dates so Cargo can rebuild. Matching source directories also receive their original dates where appropriate.&lt;/p&gt;

&lt;p&gt;The first ripgrep evaluation exposed a small but costly detail: JavaScript lost nanosecond precision when restoring timestamps, and one crate still compiled. Switching to Python’s nanosecond timestamp operations fixed the problem. The measured unchanged optimized builds then compiled zero crates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relocate build-script records
&lt;/h3&gt;

&lt;p&gt;Build scripts can record absolute paths for Cargo to watch. Those records are saved inside the build folder, as described in the &lt;a href="https://doc.rust-lang.org/cargo/reference/build-scripts.html" rel="noopener noreferrer"&gt;Cargo build-script documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Cloned records may still point into the main checkout. Faster Rust Work Trees replaces those checkout prefixes with the new worktree’s path and restores the exact record timestamps. Paths embedded inside compiled programs or generated files may need additional handling specific to the repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the build settings consistent
&lt;/h3&gt;

&lt;p&gt;A debug build won’t supply a missing release build. Changes to features, compiler versions, targets, environment settings, or commands can also require compilation. Prepare the main checkout using the same commands the new worktrees will run. Keep Cargo output inside each checkout and leave &lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt; unset. Stop builds before cloning: a build folder being modified is not a consistent snapshot.&lt;/p&gt;

&lt;p&gt;The integration test checks both reuse and independence in a real Cargo workspace. An unchanged first build compiles no crates. After a dependency changes in one worktree, two concurrent builds produce independent results: the changed program prints &lt;code&gt;43&lt;/code&gt;, while the other worktree and the original executable still print &lt;code&gt;42&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers for three worktrees
&lt;/h2&gt;

&lt;p&gt;Creation plus first-build time for three worktrees, with unchanged sources and a main checkout already built with matching settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy9pfjojm313hlsx5upp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy9pfjojm313hlsx5upp0.png" alt="Build-time gains for three worktrees: late-sh is 24 times faster, ripgrep 11.5 times faster, and fd 11.4 times faster. Each ordinary bar represents 100 percent of that project’s total." width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additional allocated space with three built worktrees retained together:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6onvy01fq2r0g92oyyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6onvy01fq2r0g92oyyn.png" alt="Disk-space gains for three built worktrees: 97.6 percent saved for late-sh, 98.3 percent for ripgrep, and 99.2 percent for fd. Each ordinary bar represents 100 percent of that project’s additional allocation." width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get the three-worktree figures, the charts use three tenths of the ten-worktree measurements for late-sh timing and all storage results. Ripgrep and fd times use three times their one-worktree medians.&lt;/p&gt;

&lt;p&gt;The one-worktree comparisons and the ripgrep and fd storage comparisons were repeated three times. The late-sh ten-worktree comparison has one complete paired run. All measured optimized unchanged first builds compiled zero crates.&lt;/p&gt;

&lt;p&gt;The time totals cover sequential creation and first builds, not three simultaneous builds. Cloning and preparing output can make worktree creation itself slower. The saving comes in the first build. Initial compilation in the main checkout and later source changes still cost time.&lt;/p&gt;

&lt;p&gt;Storage was measured on an isolated Apple File System volume with all worktrees retained together and shared blocks counted once. The figures exclude the built main checkout and common Cargo caches. Adding up apparent folder sizes would count shared data repeatedly.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/blob/main/docs/evaluation/late_sh_measurements.md" rel="noopener noreferrer"&gt;late-sh measurements&lt;/a&gt;, &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/blob/main/docs/evaluation/evaluation.md" rel="noopener noreferrer"&gt;timing evaluation&lt;/a&gt;, and &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/blob/main/docs/evaluation/space_measurements.md" rel="noopener noreferrer"&gt;storage measurements&lt;/a&gt; include conditions, raw evidence, and reproduction methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the skill with your coding agent
&lt;/h2&gt;

&lt;p&gt;The intended workflow is to let your coding agent handle setup and worktree creation. You don’t need to learn the underlying command-line tool.&lt;/p&gt;

&lt;p&gt;Start by installing the &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/tree/main/skills/faster_rust_worktrees" rel="noopener noreferrer"&gt;faster_rust_worktrees skill&lt;/a&gt; for your coding agent. A skill is a reusable set of instructions. The &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees" rel="noopener noreferrer"&gt;repository&lt;/a&gt; is the starting point for installation and setup details.&lt;/p&gt;

&lt;p&gt;Once the skill is available, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use faster_rust_worktrees to configure this Rust repository. Verify that unchanged builds reuse Cargo output and that source changes still build and test correctly. Integrate Faster Rust Work Trees into this repository’s worktree workflow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The coding agent discovers the real build and test commands, prepares the main checkout’s output, checks file-system support, and verifies reuse in a disposable worktree. After those checks pass, the coding agent updates the repository’s worktree instructions so later coding tasks use the configured workflow.&lt;/p&gt;

&lt;p&gt;Then ask for your next task as usual:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fix this issue in a new worktree, using the repository’s configured Faster Rust Work Trees workflow. Run the relevant tests and prepare the changes for review.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The coding agent creates the branch and worktree, reuses the existing build output, makes the changes, and runs the tests. You review the result. Source changes still require compilation; unchanged dependencies are where the repeated work can be avoided.&lt;/p&gt;

&lt;p&gt;macOS has live verification. Linux support is implemented, but evaluation on a suitable Linux file system remains pending. The skill is still Draft, and unattended adoption hasn’t been evaluated, so the first setup includes verification in your actual repository.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/jeromeetienne/faster-rust-worktrees/blob/main/skills/faster_rust_worktrees/references/setup.md" rel="noopener noreferrer"&gt;setup reference&lt;/a&gt; covers requirements, configuration, and cleanup for the coding agent to follow.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>git</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
