From 53f4444c5ac9cc1c14749afb7ba2c3ccd1929889 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 25 Jul 2026 19:10:47 +0900 Subject: perf(advisory): share AnySecurityAdvisory via Rc PHP's SecurityAdvisoryPoolFilter stores advisory *object references* in $securityRemovedVersions, and PoolOptimizer::applyRemovalsToPool hands that array to the new Pool by copy-on-write. Porting AnySecurityAdvisory as a value type turned both of those into deep copies. Measured on `require laravel/framework` (offline, warm cache): 113 distinct advisories were duplicated into 314,309 copies of ~1.08 KiB, retaining 331.9 MiB in the filter loop and another 331.9 MiB when apply_removals_to_pool cloned the whole map. 3.54s -> 2.62s (-26%), peak RSS 975 MB -> 343 MB, which matches the upper bound measured by ablation. Composer runs the same workload in 1.49s. Co-Authored-By: Claude Opus 5 (1M context) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index d9016c63..e414c493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ mockall = "0.14.0" regex = "1.12.3" regex-macro = "0.3.0" reqwest = { version = "0.13.4", features = ["blocking"] } -serde = { version = "1.0.228", features = ["derive"] } +serde = { version = "1.0.228", features = ["derive", "rc"] } serde_json = { version = "1.0.149", features = ["preserve_order"] } serde_urlencoded = "0.7.1" serial_test = "3.5.0" -- cgit v1.3.1