Tvix is a new implementation of the Nix language and package manager.
In this benchmark we test it's performance when instantiating the hello package from nix.
Note that at the time tvix does not have its own store implementation yet and it has to
execute nix-store
whenever it needs to copy files to the store.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, config, ... }: | |
{ | |
nixpkgs.config.allowUnfree = true; | |
nixpkgs.config.nvidia.acceptLicense = true; | |
# enable the nvidia driver | |
services.xserver.videoDrivers = [ "nvidia" ]; | |
hardware.opengl.enable = true; | |
hardware.nvidia.datacenter.enable = true; | |
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.dc_535; |
hyperfine --show-output 'rm -R ~/.cache/nix/binary-cache-*.sqlite*; rm -rf /tmp/cache; nix copy --from "{url}" --to "file:///tmp/cache?compression=none" /nix/store/jlkypcf54nrh4n6r0l62ryx93z752hb2-firefox-132.0' -L url https://nixos.tvix.store,https://cache.nixos.org/
Benchmark 1: rm -R ~/.cache/nix/binary-cache-*.sqlite*; rm -rf /tmp/cache; nix copy --from "https://nixos.tvix.store" --to "file:///tmp/cache?compression=none" /nix/store/jlkypcf54nrh4n6r0l62ryx93z752hb2-firefox-132.0
Time (mean ± σ): 5.090 s ± 0.113 s [User: 4.721 s, System: 2.555 s]
Range (min … max): 4.942 s … 5.332 s 10 runs
Benchmark 2: rm -R ~/.cache/nix/binary-cache-*.sqlite*; rm -rf /tmp/cache; nix copy --from "https://cache.nixos.org/" --to "file:///tmp/cache?compression=none" /nix/store/jlkypcf54nrh4n6r0l62ryx93z752hb2-firefox-132.0
Time (mean ± σ): 6.729 s ± 0.148 s [User: 15.829 s, System: 2.904 s]
Range (min … max): 6.560 s … 7.049 s 10 runs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nixos/modules/system/etc/build-composefs-dump.py b/nixos/modules/system/etc/build-composefs-dump.py | |
index fe739a621ec4..42287ea35842 100644 | |
--- a/nixos/modules/system/etc/build-composefs-dump.py | |
+++ b/nixos/modules/system/etc/build-composefs-dump.py | |
@@ -1,5 +1,3 @@ | |
-#!/usr/bin/env python3 | |
- | |
"""Build a composefs dump from a Json config | |
See the man page of composefs-dump for details about the format: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code was autogenerated with `dbus-codegen-rust `, see https://github.com/diwic/dbus-rs | |
use dbus as dbus; | |
#[allow(unused_imports)] | |
use dbus::arg; | |
use dbus::blocking; | |
pub trait OrgFreedesktopDBusPeer { | |
fn ping(&self) -> Result<(), dbus::Error>; | |
fn get_machine_id(&self) -> Result<String, dbus::Error>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, modulesPath, ... }: | |
{ imports = | |
[ ./hardware-configuration.nix | |
<nixpkgs/nixos/modules/testing/test-instrumentation.nix> | |
]; | |
networking.hostName = "thatworked"; | |
documentation.enable = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"log" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell -i bash -p bash -p qemu_kvm -p iproute2 | |
set -x -eu -o pipefail | |
VM_IMAGE="" | |
CPUS="${CPUS:-$(nproc)}" | |
MEMORY="${MEMORY:-4096}" | |
SSH_PORT="${SSH_PORT:-2222}" | |
IMAGE_SIZE="${IMAGE_SIZE:-10G}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xeuo pipefail | |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
# shellcheck disable=SC1090 | |
source "$SCRIPT_DIR/env.sh" | |
: "${host:?}" | |
: "${ssh_user:=root}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 1 0x01 147 39984 2088515013 55466767689355 | |
name type data | |
hits 4 227098528 | |
iohits 4 162963 | |
misses 4 1148629 | |
demand_data_hits 4 48027529 | |
demand_data_iohits 4 659 | |
demand_data_misses 4 267582 | |
demand_metadata_hits 4 178122149 | |
demand_metadata_iohits 4 4992 |
NewerOlder