Commit Graph

17 Commits

Author SHA1 Message Date
Tunglies
f9b8a658a1 perf(draft): optimize memory layout by removing double indirection & implemented optimistic locking via Arc::ptr_eq for with_data_modify (#5942)
* 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.
2025-12-25 16:44:23 +08:00
oomeow
19accbd538 chore: rust related config for workspace (#5912)
* chore: move rust related config to workspace

* chore: cargo fmt
2025-12-22 15:28:55 +08:00
Tunglies
5b63f350ed fix: update edition and rust-version fields in Cargo.toml files 2025-12-15 14:17:56 +08:00
Tunglies
90b1c6e153 refactor(signal): migrate signal to handling async in windows and remove windows_sys dependency (#5741)
* refactor(signal): migrate signal to handling async in windows and remove signal-hook dependency

* refactor(signal): enhance Windows signal handling with improved cleanup logic

* refactor(signal): improve exit handling in run function for async compatibility
2025-12-06 11:33:49 +08:00
Tunglies
2ca8e6716d style: adjust rustfmt max_width to 120 2025-12-06 10:31:31 +08:00
Tunglies
d28075221c refactor(signal): migrate signal to handling async in unix and remove signal-hook dependency 2025-12-06 06:41:47 +08:00
renovate[bot]
76eb063f7d chore(deps): update cargo dependencies (#5699)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-03 12:18:43 +08:00
Tunglies
6897ead070 perf: change patch_config parameter from Mapping to &Mapping for efficiency 2025-11-30 20:44:21 +08:00
Tunglies
ecc272aa20 feat: integrate tauri-plugin-clipboard-manager and add system info commands (#5593) 2025-11-25 16:58:25 +08:00
oomeow
cbab199f80 fix: failed to receive shutdown signal on windows (#5533)
* fix: receive shutdown signal failed on windows

* docs: update Changelog.md

* chore: update

* fix: use tokio runtime to handle shutdown signal

* docs: update Changelog.md

* fix: move tauri dependency to the correct section in Cargo.toml

* fix: remove unused exit handling code in run function

* fix(clash-verge-signal): use global runtime to avoid tokio runtime panic on unix

* chore: update tauri-plugin-mihomo deps

* fix: handle macOS exit event to ensure proper application termination

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
2025-11-22 22:36:00 +08:00
Tunglies
a271ba6ce5 feat: add update_proxy_chain_config method with detailed documentation for proxy and proxy-group configuration 2025-11-22 16:30:25 +08:00
Tunglies
82bed4910e perf: refactor IRuntime to use HashSet for exists_keys and improve related functions performance 2025-11-22 16:25:50 +08:00
Tunglies
c82cefe80e feat: add clash-verge-types crate and integrate IRuntime struct 2025-11-22 15:33:24 +08:00
Tunglies
ba3cd9b006 refactor: simplify IVerge struct by deriving Default and removing manual implementation 2025-11-19 18:40:53 +08:00
Tunglies
8339fabb17 feat(sysinfo): add tauri-plugin-clash-verge-sysinfo for system information retrieval (#5510)
* feat(sysinfo): add tauri-plugin-clash-verge-sysinfo for system information retrieval

* feat(sysinfo): add tauri-plugin-clash-verge-sysinfo for system information retrieval

* fix(service): import Manager trait for app handle in linux_running_as_root function
2025-11-18 15:48:48 +08:00
Tunglies
e672d19622 feat(signal): add clash-verge-signal crate and integrate signal handling (#5500)
* feat(signal): add clash-verge-signal crate and integrate signal handling

* fix: clippy error on type complexity
2025-11-18 10:04:21 +08:00
Tunglies
056af768e5 feat: initialize workspace with clash-verge-draft and clash-verge-logging crates (#5489)
- Add Cargo.toml for workspace management, including dependencies and profiles.
- Create clash-verge-draft crate with basic structure, including a benchmark for Draft functionality.
- Implement Draft management with shared state and asynchronous modifications.
- Add tests for Draft functionality to ensure correctness.
- Create clash-verge-logging crate for logging utilities with structured log types and macros.
- Update src-tauri to use new crates and remove unnecessary configurations.
- Refactor existing code to utilize the new Draft and logging functionalities.
2025-11-17 11:51:50 +08:00