mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
* perf(draft): optimize memory layout by removing double indirection - Replace `Arc<Box<T>>` with `Arc<T>` to reduce pointer chasing and memory overhead. - Leverage `Arc::from(Box<T>)` in async modify path for efficient ownership transfer. - Fix race conditions in `edit_draft` by ensuring atomicity under write lock. - Performance improved by ~16-24% across all operations (based on Criterion bench). Benchmarks: - latest_arc: 41.1ns (-24.2%) - edit_draft: 92.2ns (-17.6%) - apply: 89.8ns (-17.7%) - async_modify: 66.0ns (-16.6%) * perf(draft): implemented optimistic locking via Arc::ptr_eq for with_data_modify Benchmarks confirm only a negligible ~2% (1.3ns) overhead for async operations, ensuring total data integrity during concurrent updates.