aboutsummaryrefslogtreecommitdiffhomepage
path: root/Cargo.toml
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-19 09:38:20 +0900
committernsfisis <nsfisis@gmail.com>2026-08-19 09:38:20 +0900
commit1d2d1a47f6b1cc98b82d5dc8a0574b13593dbb60 (patch)
tree85b1d2ddd035fb876f9ce666b39e85f2dd178627 /Cargo.toml
parent0feaef06d0a4b3476a5d2ac53119a67559cd0a82 (diff)
downloadphp-shirabe-1d2d1a47f6b1cc98b82d5dc8a0574b13593dbb60.tar.gz
php-shirabe-1d2d1a47f6b1cc98b82d5dc8a0574b13593dbb60.tar.zst
php-shirabe-1d2d1a47f6b1cc98b82d5dc8a0574b13593dbb60.zip
perf(shirabe): use mimalloc as the global allocator
Profiling `create-project` showed glibc malloc/free accounting for about 41% of samples: the work is dominated by a very large number of small, short-lived allocations, mostly from decoding repository JSON into PhpMixed. `create-project laravel/laravel`, offline against a warmed cache, all three variants measured in one hyperfine run (8 runs each, identical composer.lock): glibc 3.633 s +- 0.023 (user 3.580 s, sys 2.255 s) mimalloc 3.096 s +- 0.054 (user 3.004 s, sys 2.315 s) -14.8% jemalloc 3.177 s +- 0.028 (user 3.136 s, sys 2.285 s) -12.5% The gain is entirely in user time; system time is unchanged, so the extraction and file-writing half of the run is unaffected. Peak RSS drops slightly, from 267 MB to 257 MB. mimalloc wins over jemalloc and, unlike jemalloc, needs no C build of its own at every profile. The allocator is declared in the library rather than in `main.rs` so that the test and benchmark binaries, which link this crate but not `main.rs`, run against the allocator the binary ships with. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml1
1 files changed, 1 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 657f7da6..22504795 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,6 +38,7 @@ indexmap = { version = "2.14.0", features = ["serde"] }
jsonschema = { version = "0.46.6", default-features = false }
md5 = "0.7.0"
memchr = "2.8.3"
+mimalloc = "0.1.52"
mockall = "0.14.0"
nix = { version = "0.31.3", features = ["feature", "fs", "poll", "process", "signal", "user"] }
regex = "1.12.3"