Skip to content

Add paths to the store asynchronously#162

Merged
edolstra merged 1 commit intodetsys-mainfrom
async-path-writer
Jul 28, 2025
Merged

Add paths to the store asynchronously#162
edolstra merged 1 commit intodetsys-mainfrom
async-path-writer

Conversation

@edolstra
Copy link
Collaborator

@edolstra edolstra commented Jul 28, 2025

Motivation

Adding paths to the store can be slow due to I/O overhead, but especially when going through the daemon because of the round-trip latency of every wopAddToStore call.

So we now do the addToStore() calls asynchronously from a separate thread from the evaluator. This slightly speeds up the local store, and makes going through the daemon almost as fast as a local store.

Timings doing nix eval github:NixOS/hydra/b812bb5017cac055fa56ffeac5440b6365830d67#nixosConfigurations.container.config.system.build.toplevel:

  • Local store, before: 4.53s
  • Local store, after: 4.30s
  • Daemon, before: 6.05s
  • Daemon, after: 4.67s

Context

@edolstra edolstra force-pushed the async-path-writer branch from 87d1096 to a1d86ad Compare July 28, 2025 14:52
@github-actions
Copy link

github-actions bot commented Jul 28, 2025

@github-actions github-actions bot temporarily deployed to pull request July 28, 2025 14:57 Inactive
@edolstra edolstra force-pushed the async-path-writer branch from a1d86ad to 5b14ce0 Compare July 28, 2025 15:20
@github-actions github-actions bot temporarily deployed to pull request July 28, 2025 15:25 Inactive
Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a rebase now that the dependency PRs have merged, but otherwise LGTM I think.

Adding paths to the store can be slow due to I/O overhead, but
especially when going through the daemon because of the round-trip
latency of every wopAddToStore call.

So we now do the addToStore() calls asynchronously from a separate
thread from the evaluator. This slightly speeds up the local store,
and makes going through the daemon almost as fast as a local store.
@edolstra edolstra force-pushed the async-path-writer branch from 5b14ce0 to 268d1b1 Compare July 28, 2025 16:17
@github-actions github-actions bot temporarily deployed to pull request July 28, 2025 16:21 Inactive
@edolstra edolstra added this pull request to the merge queue Jul 28, 2025
Merged via the queue into detsys-main with commit 4500763 Jul 28, 2025
34 checks passed
@edolstra edolstra deleted the async-path-writer branch July 28, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants