Fast and robust atproto CAR file processing in rust

use mimalloc for disk read example

looks like another 7% improvement for ~free (allocator joke)

+49
+42
Cargo.lock
··· 200 200 ] 201 201 202 202 [[package]] 203 + name = "cc" 204 + version = "1.2.52" 205 + source = "registry+https://github.com/rust-lang/crates.io-index" 206 + checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" 207 + dependencies = [ 208 + "find-msvc-tools", 209 + "shlex", 210 + ] 211 + 212 + [[package]] 203 213 name = "cfg-if" 204 214 version = "1.0.3" 205 215 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 521 531 checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 522 532 523 533 [[package]] 534 + name = "find-msvc-tools" 535 + version = "0.1.7" 536 + source = "registry+https://github.com/rust-lang/crates.io-index" 537 + checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" 538 + 539 + [[package]] 524 540 name = "fjall" 525 541 version = "3.0.1" 526 542 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 800 816 checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" 801 817 802 818 [[package]] 819 + name = "libmimalloc-sys" 820 + version = "0.1.44" 821 + source = "registry+https://github.com/rust-lang/crates.io-index" 822 + checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" 823 + dependencies = [ 824 + "cc", 825 + "libc", 826 + ] 827 + 828 + [[package]] 803 829 name = "linux-raw-sys" 804 830 version = "0.11.0" 805 831 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 857 883 version = "2.7.6" 858 884 source = "registry+https://github.com/rust-lang/crates.io-index" 859 885 checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 886 + 887 + [[package]] 888 + name = "mimalloc" 889 + version = "0.1.48" 890 + source = "registry+https://github.com/rust-lang/crates.io-index" 891 + checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" 892 + dependencies = [ 893 + "libmimalloc-sys", 894 + ] 860 895 861 896 [[package]] 862 897 name = "miniz_oxide" ··· 1121 1156 "ipld-core", 1122 1157 "iroh-car", 1123 1158 "log", 1159 + "mimalloc", 1124 1160 "multibase", 1125 1161 "serde", 1126 1162 "serde_bytes", ··· 1275 1311 "cpufeatures", 1276 1312 "digest", 1277 1313 ] 1314 + 1315 + [[package]] 1316 + name = "shlex" 1317 + version = "1.3.0" 1318 + source = "registry+https://github.com/rust-lang/crates.io-index" 1319 + checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1278 1320 1279 1321 [[package]] 1280 1322 name = "signal-hook-registry"
+1
Cargo.toml
··· 29 29 multibase = "0.9.2" 30 30 tempfile = "3.23.0" 31 31 tokio = { version = "1.47.1", features = ["full"] } 32 + mimalloc = "0.1.48" 32 33 33 34 [profile.profiling] 34 35 inherits = "release"
+6
examples/disk-read-file/main.rs
··· 3 3 */ 4 4 5 5 extern crate repo_stream; 6 + 7 + use mimalloc::MiMalloc; 8 + 9 + #[global_allocator] 10 + static GLOBAL: MiMalloc = MiMalloc; 11 + 6 12 use clap::Parser; 7 13 use repo_stream::{DiskBuilder, Driver, DriverBuilder}; 8 14 use std::path::PathBuf;