Skip to content

Instantly share code, notes, and snippets.

@polynomialspace
Created October 3, 2023 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polynomialspace/fd1b0c964466173d182021579bb67bc5 to your computer and use it in GitHub Desktop.
Save polynomialspace/fd1b0c964466173d182021579bb67bc5 to your computer and use it in GitHub Desktop.
erofs test

TL;DR

Filesystem Time Size
SquashFS 5m53.945s 17G
EroFS 5m26.367s 41G
EroFS (lz4hc) - dnf

Test inputs

Source: Nix store

$ du -hd1 /nix
24G	/nix/store
67M	/nix/var
24G	/nix

Hardware

OS: NixOS 23.11pre530560.f5892ddac112 (Tapir) x86_64 
Host: ASRockRack X570D4U 
Kernel: 6.1.54 
CPU: AMD Ryzen 9 5950X (32) @ 3.400GHz 
Memory: 2x Micron 16ATF2G64AZ-3G2J1 3200 MT/s
		21970MiB / 32029MiB 
Disk model: Samsung SSD 970 EVO Plus 1TB

(CPU configured at low power limit; likely not representative for a normal R95950X system)

Results

SquashFS

$ time sudo mksquashfs /nix nix.sqfs
Parallel mksquashfs: Using 32 processors
Creating 4.0 filesystem on nix.sqfs, block size 131072.
[============================================================================-] 817230/817230 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	4k unaligned
	duplicates are removed
Filesystem size 17110252.61 Kbytes (16709.23 Mbytes)
	40.25% of uncompressed filesystem size (42508165.84 Kbytes)
Inode table size 9092367 bytes (8879.26 Kbytes)
	26.79% of uncompressed inode table size (33943495 bytes)
Directory table size 15175557 bytes (14819.88 Kbytes)
	48.68% of uncompressed directory table size (31174531 bytes)
[Number of duplicate files found 262721
Number of inodes 800743
Number of files 529839
Number of fragments 21099
Number of symbolic links 75423
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 2
Number of directories 195479
Number of hard-links 170798
Number of ids (unique uids + gids) 4
[...]

real	5m53.945s
user	0m0.010s
sys	0m0.047s

$ ls -lh nix.sqfs 
-rw-r--r-- 1 root root 17G Oct  3 14:09 nix.sqfs

EroFS

$ time sudo mkfs.erofs nix.erofs /nix
mkfs.erofs 1.7
Build completed.
------
Filesystem UUID: aa4e57f6-c23b-4518-979c-17450c1b2d5c
Filesystem total blocks: 10635822 (of 4096-byte blocks)
Filesystem total inodes: 800743
Filesystem total metadata blocks: 215571
Filesystem total deduplicated bytes (of source files): 0

real	5m26.367s
user	0m2.048s
sys	0m7.193s
$ ls -lh nix.erofs 
-rw-r--r-- 1 root root 41G Oct  3 14:17 nix.erofs

EroFS (lz4hc)

$ time sudo mkfs.erofs -zlz4hc nix.erofs /nix
mkfs.erofs 1.7
Processing store/.links/1rxvlg6i8ww1vx074ydn4ynlw5zdihlacmjvv5x294qsj5c7xj23 ...^C

real	22m44.699s
user	0m0.394s
sys	0m1.248s

(>10min is too long imo)

@polynomialspace
Copy link
Author

Baseline / "basic" options for erofs not suitable for my interests. Likely going through the (many) tuneables could achieve much better, however image creation speed doesn't seem to be a particular focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment