All posts

Workspace Cloning now 6x Faster

Workspace Cloning now 6x Faster cover image

The latest feature for Tarsk is technique for creating workspaces 6x faster, taking up very little storage and 35x less disk activity. It uses a feature of APFS (for Macs) called copy-on-write and in our benchmark took 10 seconds and used 80 MB of space for a process that used to take 65 seconds and use 2.8 GB.

This helps when using workspaces in Tarsk for parallel work. You wait less for setup, and you keep more free space for active work.

New workspaces reuse local data

A normal new workspace starts with a fresh clone. It also installs dependencies and runs any setup scripts before the project is ready.

Large repositories pay most of that cost in dependency setup. In our benchmark, dependency setup took 59 of 65 second startup.

Copy-on-write workspaces change that process when Tarsk has a local workspace for the repository. Tarsk creates the new workspace from local files, then refreshes it to the latest default branch.

You still get an isolated workspace. Tarsk skips most setup work each time.

The speed and space difference

The benchmark used a 1.9 GB repository with 141,638 files on macOS with APFS.

Measure Copy-on-write Clone + install
Total time 10.3s 65.4s
Real disk used 80 MB 2,881 MB
Relative speed 6.4x faster baseline
Relative disk use 36x lighter baseline

Most of the gain comes from reused local data. The new workspace reuses dependencies and build output from the source workspace.

That matters most in repositories with large dependency trees or generated files. The more setup your project repeats, the more copy-on-write workspaces help.

Parallel work gets easier

Fast workspace creation changes how you work in Tarsk.

  • Start a branch for a bug fix without waiting a minute
  • Open another branch for an experiment
  • Keep review, test, and implementation work in separate workspaces
  • Create more workspaces before disk use becomes a problem

Disk savings matter as much as speed. Copy-on-write workspaces share disk blocks until files change. A new workspace starts near metadata cost, not full copy cost.

In the benchmark, copy-on-write used 45 to 80 MB of new disk for a 1.9 GB repository. A normal copy or fresh install used close to 2 to 3 GB.

When Tarsk uses copy-on-write

Tarsk uses copy-on-write when it can reuse a local workspace of the same repository on a compatible filesystem. After the copy, Tarsk updates the new workspace to the latest default branch.

Tarsk uses copy-on-write when these conditions are true:

  • You have a local workspace for that repository
  • Your source and destination are on the same volume
  • Your filesystem supports copy-on-write for this type of copy

Tarsk uses a normal clone when those conditions do not hold.

What the numbers mean for you

This benchmark covers one machine and one run. Use it as a directional result, not a promise for every project.

Even with that limit, the difference is clear:

  • New workspaces start in seconds instead of over a minute
  • Disk use stays small until files diverge
  • Large dependency trees stop dominating branch setup

The test used a warm package cache, which helps the old process. On a machine without cached packages, the gap can grow.

Use more workspaces with less waiting

Copy-on-write workspaces make it easier to keep separate branches for separate tasks. You spend less time on setup, and Tarsk uses a normal clone when copy-on-write is not available.

  • Tarsk cut setup time from 65.4 seconds to 10.3 seconds in our benchmark.
  • Tarsk cut real disk use from 2,881 MB to 80 MB.
  • Tarsk uses a normal clone when copy-on-write is not available.

Download Tarsk and create a new workspace in a large repository.

Download Tarsk · Read the docs