├── .gitignore ├── benchmark.py ├── hardware.md └── report.md /.gitignore: -------------------------------------------------------------------------------- 1 | /tvix 2 | -------------------------------------------------------------------------------- /benchmark.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import shlex 3 | import os 4 | from pathlib import Path 5 | 6 | 7 | def run( 8 | args: list[str], cwd: Path | str | None = None 9 | ) -> subprocess.CompletedProcess[str]: 10 | print(f"$ {shlex.join(args)}") 11 | return subprocess.run(args, check=True, stdout=subprocess.PIPE, cwd=cwd, text=True) 12 | 13 | 14 | def nix_build(package: str) -> str: 15 | proc = run(["nix", "build", "--print-out-paths", package]) 16 | return proc.stdout.strip() 17 | 18 | 19 | def main() -> None: 20 | lix_path = nix_build("git+https://git.lix.systems/lix-project/lix") 21 | nix_path = nix_build("github:NixOS/nix") 22 | tvix_path = Path("tvix") 23 | if not tvix_path.exists(): 24 | run(["git", "clone", "https://github.com/tvlfyi/tvix"]) 25 | run(["git", "-C", str(tvix_path), "fetch", "origin", "canon"]) 26 | run(["git", "-C", str(tvix_path), "reset", "--hard", "origin/canon"]) 27 | run(["nix-shell", "--run", "cargo build --release"], cwd=tvix_path) 28 | inxi = run( 29 | [ 30 | "nix-shell", 31 | "-p", 32 | "inxi.override { withRecommends = true; }", 33 | "--run", 34 | "sudo inxi -F -a -i --slots -xxx -c0 -Z -i -m", 35 | ] 36 | ) 37 | Path("hardware.md").write_text(f"```\n{inxi.stdout.strip()}\n```") 38 | hyperfine_command = [ 39 | "hyperfine", 40 | "--export-json", 41 | "report.json", 42 | f"{tvix_path}/target/release/tvix --no-warnings -E 'with import {{}}; toString hello'", 43 | f"{lix_path}/bin/nix-instantiate --eval --json --expr 'with import {{}}; toString hello'", 44 | f"{nix_path}/bin/nix-instantiate --eval --json --expr 'with import {{}}; toString hello'", 45 | ] 46 | run(["nix", "shell", "nixpkgs#hyperfine", "--command"] + hyperfine_command) 47 | 48 | 49 | if __name__ == "__main__": 50 | main() 51 | -------------------------------------------------------------------------------- /hardware.md: -------------------------------------------------------------------------------- 1 | ``` 2 | System: Host: ryan Kernel: 6.8.0 x86_64 bits: 64 compiler: gcc v: 12.3.0 3 | parameters: initrd=\efi\nixos\5yg6ab4rpkqml5jkgcdjysvnhcbdibm3-initrd-linux-6.8-vcreflection-initrd.efi 4 | init=/nix/store/cfd8rwqz19mpmih3qzp2b8izzjzlq3l2-nixos-system-ryan-23.11.20240505.22f1657/init console=tty0 5 | console=ttyS0,115200 amd_iommu=on kvm_amd.sev=1 kvm_amd.sev_es=1 kvm_amd.sev_snp=1 sp5100_tco.blacklist=yes 6 | nohibernate loglevel=4 7 | Console: tty pts/28 DM: LightDM 1.32.0 Distro: NixOS 23.11 (Tapir) 8 | Machine: Type: Server System: Dell product: PowerEdge R7515 v: N/A serial: 9P0PSH3 Chassis: type: 23 serial: 9P0PSH3 9 | Mobo: Dell model: 07PXPY v: A04 serial: .9P0PSH3.CNCMS0016O01PE. UEFI: Dell v: 2.9.3 date: 08/05/2022 10 | Memory: RAM: total: 991.24 GiB used: 54.52 GiB (5.5%) 11 | Array-1: capacity: 2 TiB slots: 16 EC: Multi-bit ECC max-module-size: 128 GiB note: est. 12 | Device-1: A1 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 13 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 14 | part-no: HMAA8GR7AJR4N-XN serial: 24178C4F 15 | Device-2: A2 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 16 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 17 | part-no: HMAA8GR7AJR4N-XN serial: 241789BA 18 | Device-3: A3 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 19 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 20 | part-no: HMAA8GR7AJR4N-XN serial: 2414B4EC 21 | Device-4: A4 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 22 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 23 | part-no: HMAA8GR7AJR4N-XN serial: 2414B4D8 24 | Device-5: A5 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 25 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 26 | part-no: HMAA8GR7AJR4N-XN serial: 2414B4E0 27 | Device-6: A6 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 28 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 29 | part-no: HMAA8GR7AJR4N-XN serial: 2414B528 30 | Device-7: A7 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 31 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 32 | part-no: HMAA8GR7AJR4N-XN serial: 2414B4E6 33 | Device-8: A8 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 34 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD869D80AD 35 | part-no: HMAA8GR7AJR4N-XN serial: 2414B4EF 36 | Device-9: A9 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 37 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 38 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA74 39 | Device-10: A10 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 40 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 41 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA73 42 | Device-11: A11 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 43 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 44 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA46 45 | Device-12: A12 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 46 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 47 | part-no: HMAA8GR7CJR4N-XN serial: 87D2A9CC 48 | Device-13: A13 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 49 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 50 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA91 51 | Device-14: A14 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 52 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 53 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA8B 54 | Device-15: A15 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 55 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 56 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA41 57 | Device-16: A16 size: 64 GiB speed: spec: 3200 MT/s actual: 2933 MT/s type: DDR4 58 | detail: synchronous registered (buffered) bus-width: 64 bits total: 72 bits manufacturer: 80AD863280AD 59 | part-no: HMAA8GR7CJR4N-XN serial: 87D2AA8C 60 | PCI Slots: Slot: 3 type: x16 PCI Express 4 PCIe Slot 3 status: In Use length: Long 61 | Slot: 2 type: x16 PCI Express 3 PCIe Slot 2 status: In Use length: Long 62 | Slot: 5 type: x16 PCI Express 3 PCIe Slot 5 status: In Use length: Long 63 | Slot: 4 type: x16 PCI Express 4 PCIe Slot 4 status: In Use length: Long 64 | Slot: 1 type: x8 PCI Express 3 Mezzanine 1 status: In Use length: Long 65 | CPU: Info: 64-Core model: AMD EPYC 7713P socket: SP3 bits: 64 type: MCP arch: Zen 3 family: 19 (25) model-id: 1 66 | stepping: 1 microcode: A001173 cache: L2: 32 MiB 67 | flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 255515 68 | Speed: 2000 MHz min/max: 1500/2000 MHz base/boost: 2000/3900 boost: disabled volts: 1.8 V ext-clock: 2000 MHz 69 | Core speeds (MHz): 1: 2000 2: 2000 3: 2000 4: 2000 5: 2000 6: 2000 7: 2000 8: 2000 9: 1793 10: 2000 11: 2000 70 | 12: 2000 13: 2000 14: 2000 15: 2000 16: 2000 17: 2000 18: 2000 19: 2000 20: 2000 21: 2000 22: 2000 23: 2000 71 | 24: 2000 25: 2000 26: 2000 27: 2000 28: 2000 29: 2000 30: 2000 31: 2000 32: 2000 33: 2000 34: 2000 35: 2000 72 | 36: 2000 37: 2000 38: 2000 39: 2000 40: 2000 41: 2000 42: 1996 43: 2000 44: 2000 45: 2000 46: 2000 47: 2000 73 | 48: 2000 49: 2000 50: 2000 51: 2000 52: 2000 53: 2000 54: 2000 55: 2000 56: 2000 57: 1732 58: 2000 59: 2000 74 | 60: 2000 61: 2000 62: 2000 63: 2000 64: 2000 75 | Vulnerabilities: Type: gather_data_sampling status: Not affected 76 | Type: itlb_multihit status: Not affected 77 | Type: l1tf status: Not affected 78 | Type: mds status: Not affected 79 | Type: meltdown status: Not affected 80 | Type: mmio_stale_data status: Not affected 81 | Type: retbleed status: Not affected 82 | Type: spec_rstack_overflow status: Vulnerable: Safe RET, no microcode 83 | Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl 84 | Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 85 | Type: spectre_v2 86 | mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected 87 | Type: srbds status: Not affected 88 | Type: tsx_async_abort status: Not affected 89 | Graphics: Device-1: Matrox Systems Integrated Matrox G200eW3 Graphics driver: mgag200 v: kernel bus-ID: c3:00.0 90 | chip-ID: 102b:0536 class-ID: 0300 91 | Display: server: X.org 1.21.1.12 driver: loaded: mgag200 note: n/a (using device driver) tty: 161x43 92 | Message: Advanced graphics data unavailable in console for root. 93 | Audio: Message: No device data found. 94 | Network: Device-1: Broadcom BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet vendor: Dell driver: bnxt_en v: kernel 95 | port: 1000 bus-ID: 02:00.0 chip-ID: 14e4:16d8 class-ID: 0200 96 | IF: enp2s0f0np0 state: up speed: 10000 Mbps duplex: full mac: 2c:ea:7f:af:56:78 97 | IP v4: 131.159.102.8/24 type: dynamic scope: global 98 | IP v6: 2a09:80c0:102::8/128 type: dynamic noprefixroute scope: global 99 | IP v6: fe80::2eea:7fff:feaf:5678/64 virtual: proto kernel_ll scope: link 100 | Device-2: Broadcom BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet vendor: Dell driver: bnxt_en v: kernel 101 | port: 1000 bus-ID: 02:00.1 chip-ID: 14e4:16d8 class-ID: 0200 102 | IF: enp2s0f1np1 state: down mac: 2c:ea:7f:af:56:79 103 | Device-3: Broadcom NetXtreme BCM5720 Gigabit Ethernet PCIe vendor: Dell PowerEdge R6515/R7515 LOM driver: tg3 104 | v: kernel port: 1000 bus-ID: c1:00.0 chip-ID: 14e4:165f class-ID: 0200 105 | IF: eno8303 state: down mac: d0:8e:79:ba:1a:28 106 | Device-4: Broadcom NetXtreme BCM5720 Gigabit Ethernet PCIe vendor: Dell PowerEdge R6515/R7515 LOM driver: tg3 107 | v: kernel port: 1000 bus-ID: c1:00.1 chip-ID: 14e4:165f class-ID: 0200 108 | IF: eno8403 state: down mac: d0:8e:79:ba:1a:29 109 | IF-ID-1: docker0 state: down mac: 02:42:43:a1:5d:15 110 | IP v4: 172.17.0.1/16 scope: global broadcast: 172.17.255.255 111 | IF-ID-2: tap0_patrick state: up speed: 10000 Mbps duplex: full mac: ae:a5:28:d1:d8:69 112 | IP v4: 192.168.27.1/24 scope: global 113 | IP v6: fe80::aca5:28ff:fed1:d869/64 virtual: proto kernel_ll scope: link 114 | IF-ID-3: tinc.retiolum state: unknown speed: 10000 Mbps duplex: full mac: N/A 115 | IP v6: 42:0:3c46:53a7:e0e3:a2b6:471d:44a/16 scope: global 116 | WAN IP: 131.159.102.8 117 | RAID: Hardware-1: Broadcom / LSI MegaRAID SAS-3 3008 [Fury] driver: megaraid_sas v: 07.727.03.00-rc1 port: 1000 118 | bus-ID: 01:00.0 chip-ID: 1000.005f rev: 02 class-ID: 0104 119 | Device-1: zroot type: zfs status: ONLINE level: linear size: 1.45 TiB free: 986 GiB allocated: 502 GiB 120 | Components: Online: N/A 121 | Drives: Local Storage: total: 5.3 TiB used: 3.34 TiB (63.1%) 122 | ID-1: /dev/nvme0n1 maj-min: 259:4 vendor: Dell model: Ent NVMe AGN MU AIC 1.6TB size: 1.46 TiB block-size: 123 | physical: 512 B logical: 512 B rotation: SSD serial: S61ANA0T700017 rev: 2.0.2 temp: 15 ° (288 K) C scheme: GPT 124 | SMART: yes health: PASSED on: 244d 21h cycles: 10 read-units: 11,487,676 [5.88 TB] 125 | written-units: 9,630,731 [4.93 TB] 126 | ID-2: /dev/nvme1n1 maj-min: 259:3 vendor: Dell model: Ent NVMe AGN MU AIC 1.6TB size: 1.46 TiB block-size: 127 | physical: 4096 B logical: 4096 B rotation: SSD serial: S61ANA0T700063 rev: 2.0.2 temp: 16 ° (289 K) C 128 | SMART: yes health: PASSED on: 244d 21h cycles: 10 read-units: 3,234,183 [1.65 TB] 129 | written-units: 10,064,282 [5.15 TB] 130 | ID-3: /dev/nvme2n1 maj-min: 259:0 vendor: SK Hynix model: PC801 NVMe 1TB size: 953.87 GiB block-size: 131 | physical: 512 B logical: 512 B speed: 63.2 Gb/s lanes: 4 rotation: SSD serial: SNB5N744011305V1P rev: 51002141 132 | temp: 31 ° (304 K) C 133 | SMART: yes health: PASSED on: 315d 18h cycles: 122 read-units: 1,418,306 [726 GB] 134 | written-units: 4,728,665 [2.42 TB] 135 | ID-4: /dev/nvme3n1 maj-min: 259:7 vendor: Samsung model: SSD 970 EVO Plus 1TB size: 931.51 GiB block-size: 136 | physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 rotation: SSD serial: S4EWNX0R513894H rev: 2B2QEXM7 137 | temp: 27 ° (300 K) C 138 | SMART: yes health: PASSED on: 144d 5h cycles: 18 read-units: 144,369,073 [73.9 TB] 139 | written-units: 48,371,835 [24.7 TB] 140 | ID-5: /dev/sda maj-min: 8:0 model: AL15SEB060NY size: 558.91 GiB block-size: physical: 512 B logical: 512 B 141 | speed: rotation: 10000 rpm serial: N/A rev: EF06 temp: 18 C scheme: GPT 142 | SMART: yes state: enabled 143 | Partition: ID-1: / raw-size: N/A size: 1.25 TiB used: 344.66 GiB (26.8%) fs: zfs logical: zroot/root/nixos 144 | ID-2: /boot raw-size: 1024 MiB size: 1021.9 MiB (99.80%) used: 55.1 MiB (5.4%) fs: vfat block-size: 512 B 145 | dev: /dev/sda1 maj-min: 8:1 146 | ID-3: /home raw-size: N/A size: 3.11 TiB used: 1.07 TiB (34.3%) fs: nfs4 remote: nfs:/export/home 147 | ID-4: /tmp raw-size: N/A size: 940.29 GiB used: 384 KiB (0.0%) fs: zfs logical: zroot/root/tmp 148 | Swap: Alert: No swap data was found. 149 | Sensors: Message: No ipmi sensor data found. 150 | System Temperatures: lm-sensors cpu: 49.0 C mobo: N/A 151 | Fan Speeds (RPM): lm-sensors N/A 152 | Info: Processes: 1070 Uptime: 19h 54m wakeups: 0 Init: systemd v: 254 target: graphical.target tool: systemctl Compilers: 153 | gcc: 12.3.0 Packages: 1090 nix-default: 84 nix-sys: 922 lib: 224 nix-usr: 84 lib: 12 Shell: Sudo (sudo) v: 1.9.15p2 154 | default: Bash v: 5.2.15 running-in: tty pts/28 inxi: 3.3.04 155 | ``` -------------------------------------------------------------------------------- /report.md: -------------------------------------------------------------------------------- 1 | | Command | Mean [s] | Min [s] | Max [s] | Relative | 2 | |:---|---:|---:|---:|---:| 3 | | `tvix/target/release/tvix --no-warnings -E 'with import {}; toString hello'` | 1.941 ± 0.011 | 1.928 | 1.966 | 5.45 ± 0.09 | 4 | | `/nix/store/nrnr2ddbf7cm7yblsz7lfm1sb2sb8gxa-nix-2.90.0pre20240506_106b959/bin/nix-instantiate --eval --json --expr 'with import {}; toString hello'` | 0.356 ± 0.005 | 0.352 | 0.369 | 1.00 | 5 | | `/nix/store/pzic67rvj74y4im1kvyhrzxgxj05di7c-nix-2.23.0pre20240506_20445df/bin/nix-instantiate --eval --json --expr 'with import {}; toString hello'` | 0.386 ± 0.005 | 0.380 | 0.394 | 1.08 ± 0.02 | 6 | --------------------------------------------------------------------------------