diff --git a/Cargo.toml b/Cargo.toml index c865209800..287b9b8a12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -122,14 +122,14 @@ version = "~0.1.4" path = "module/alias/std_x" [workspace.dependencies.unilang_parser] -version = "~0.11.0" +version = "~0.12.0" path = "module/move/unilang_parser" # Point to original unilang_parser ## data_type [workspace.dependencies.data_type] -version = "~0.15.0" +version = "~0.16.0" path = "module/core/data_type" default-features = false @@ -147,7 +147,7 @@ version = "~0.1.0" path = "module/core/type_constructor_derive_pair_meta" [workspace.dependencies.interval_adapter] -version = "~0.36.0" +version = "~0.37.0" path = "module/core/interval_adapter" default-features = false # features = [ "enabled" ] @@ -159,7 +159,7 @@ default-features = false # features = [ "enabled" ] [workspace.dependencies.collection_tools] -version = "~0.25.0" +version = "~0.26.0" path = "module/core/collection_tools" default-features = false @@ -167,13 +167,13 @@ default-features = false ## derive [workspace.dependencies.derive_tools] -version = "~0.47.0" +version = "~0.48.0" path = "module/core/derive_tools" default-features = false # features = [ "enabled" ] [workspace.dependencies.derive_tools_meta] -version = "~0.46.0" +version = "~0.47.0" path = "module/core/derive_tools_meta" default-features = false # features = [ "enabled" ] @@ -215,30 +215,30 @@ path = "module/alias/fundamental_data_type" default-features = false [workspace.dependencies.variadic_from] -version = "~0.41.0" +version = "~0.42.0" path = "module/core/variadic_from" default-features = false # features = [ "enabled" ] [workspace.dependencies.variadic_from_meta] -version = "~0.12.0" +version = "~0.13.0" path = "module/core/variadic_from_meta" default-features = false # features = [ "enabled" ] [workspace.dependencies.clone_dyn] -version = "~0.44.0" +version = "~0.45.0" path = "module/core/clone_dyn" default-features = false # features = [ "enabled" ] [workspace.dependencies.clone_dyn_meta] -version = "~0.41.0" +version = "~0.42.0" path = "module/core/clone_dyn_meta" # features = [ "enabled" ] [workspace.dependencies.clone_dyn_types] -version = "~0.38.0" +version = "~0.39.0" path = "module/core/clone_dyn_types" default-features = false # features = [ "enabled" ] @@ -263,7 +263,7 @@ default-features = false ## iter [workspace.dependencies.iter_tools] -version = "~0.37.0" +version = "~0.38.0" path = "module/core/iter_tools" default-features = false @@ -281,32 +281,32 @@ path = "module/core/for_each" default-features = false [workspace.dependencies.former] -version = "~2.28.0" +version = "~2.29.0" path = "module/core/former" default-features = false [workspace.dependencies.former_meta] -version = "~2.27.0" +version = "~2.28.0" path = "module/core/former_meta" default-features = false [workspace.dependencies.former_types] -version = "~2.24.0" +version = "~2.25.0" path = "module/core/former_types" default-features = false [workspace.dependencies.component_model] -version = "~0.6.0" +version = "~0.7.0" path = "module/core/component_model" default-features = false [workspace.dependencies.component_model_meta] -version = "~0.6.0" +version = "~0.7.0" path = "module/core/component_model_meta" default-features = false [workspace.dependencies.component_model_types] -version = "~0.11.0" +version = "~0.12.0" path = "module/core/component_model_types" default-features = false @@ -320,12 +320,12 @@ version = "~0.13.0" path = "module/core/impls_index_meta" [workspace.dependencies.mod_interface] -version = "~0.44.0" +version = "~0.45.0" path = "module/core/mod_interface" default-features = false [workspace.dependencies.mod_interface_meta] -version = "~0.42.0" +version = "~0.43.0" path = "module/core/mod_interface_meta" default-features = false @@ -351,7 +351,7 @@ default-features = false ## macro tools [workspace.dependencies.macro_tools] -version = "~0.67.0" +version = "~0.68.0" path = "module/core/macro_tools" default-features = false @@ -422,12 +422,12 @@ path = "module/alias/werror" ## string tools [workspace.dependencies.strs_tools] -version = "~0.29.0" +version = "~0.30.0" path = "module/core/strs_tools" default-features = false [workspace.dependencies.strs_tools_meta] -version = "~0.6.0" +version = "~0.7.0" path = "module/core/strs_tools_meta" default-features = false @@ -449,7 +449,7 @@ path = "module/alias/file_tools" default-features = false [workspace.dependencies.pth] -version = "~0.25.0" +version = "~0.26.0" path = "module/core/pth" default-features = false @@ -462,7 +462,7 @@ default-features = false ## process tools [workspace.dependencies.process_tools] -version = "~0.15.0" +version = "~0.16.0" path = "module/core/process_tools" default-features = false @@ -522,7 +522,7 @@ default-features = false ## ca [workspace.dependencies.wca] -version = "~0.28.0" +version = "~0.29.0" path = "module/move/wca" ## censor @@ -535,7 +535,7 @@ path = "module/move/wcensor" ## willbe [workspace.dependencies.willbe] -version = "~0.24.0" +version = "~0.25.0" path = "module/move/willbe" @@ -574,7 +574,7 @@ version = "~0.6.0" path = "module/move/deterministic_rand" [workspace.dependencies.crates_tools] -version = "~0.17.0" +version = "~0.18.0" path = "module/move/crates_tools" [workspace.dependencies.assistant] @@ -586,7 +586,7 @@ version = "~0.2.0" path = "module/move/llm_tools" [workspace.dependencies.benchkit] -version = "~0.9.0" +version = "~0.10.0" path = "module/core/benchkit" ## steps diff --git a/module/core/benchkit/Cargo.toml b/module/core/benchkit/Cargo.toml index 0d19f6e74f..7eb69eb509 100644 --- a/module/core/benchkit/Cargo.toml +++ b/module/core/benchkit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "benchkit" -version = "0.9.0" +version = "0.10.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/clone_dyn/Cargo.toml b/module/core/clone_dyn/Cargo.toml index 41657b8501..7078eca73b 100644 --- a/module/core/clone_dyn/Cargo.toml +++ b/module/core/clone_dyn/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clone_dyn" -version = "0.44.0" +version = "0.45.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/clone_dyn_meta/Cargo.toml b/module/core/clone_dyn_meta/Cargo.toml index 81e03782d8..ba9117fc74 100644 --- a/module/core/clone_dyn_meta/Cargo.toml +++ b/module/core/clone_dyn_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clone_dyn_meta" -version = "0.41.0" +version = "0.42.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/clone_dyn_types/Cargo.toml b/module/core/clone_dyn_types/Cargo.toml index fd195b4929..997bebf735 100644 --- a/module/core/clone_dyn_types/Cargo.toml +++ b/module/core/clone_dyn_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clone_dyn_types" -version = "0.38.0" +version = "0.39.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/collection_tools/Cargo.toml b/module/core/collection_tools/Cargo.toml index bda10cdd47..17c41e532c 100644 --- a/module/core/collection_tools/Cargo.toml +++ b/module/core/collection_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collection_tools" -version = "0.25.0" +version = "0.26.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/component_model/Cargo.toml b/module/core/component_model/Cargo.toml index d0189ddcfe..0d2276c30a 100644 --- a/module/core/component_model/Cargo.toml +++ b/module/core/component_model/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "component_model" -version = "0.6.0" +version = "0.7.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/component_model_meta/Cargo.toml b/module/core/component_model_meta/Cargo.toml index 33cc4c7188..865fa3f583 100644 --- a/module/core/component_model_meta/Cargo.toml +++ b/module/core/component_model_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "component_model_meta" -version = "0.6.0" +version = "0.7.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/component_model_types/Cargo.toml b/module/core/component_model_types/Cargo.toml index 10d71b3078..7661890454 100644 --- a/module/core/component_model_types/Cargo.toml +++ b/module/core/component_model_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "component_model_types" -version = "0.11.0" +version = "0.12.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/data_type/Cargo.toml b/module/core/data_type/Cargo.toml index 9e565be37b..2e84f9f850 100644 --- a/module/core/data_type/Cargo.toml +++ b/module/core/data_type/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "data_type" -version = "0.15.0" +version = "0.16.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/derive_tools/Cargo.toml b/module/core/derive_tools/Cargo.toml index 8975fef6de..308ad2a846 100644 --- a/module/core/derive_tools/Cargo.toml +++ b/module/core/derive_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "derive_tools" -version = "0.47.0" +version = "0.48.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/derive_tools_meta/Cargo.toml b/module/core/derive_tools_meta/Cargo.toml index bcf77f35b2..c65e5be1eb 100644 --- a/module/core/derive_tools_meta/Cargo.toml +++ b/module/core/derive_tools_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "derive_tools_meta" -version = "0.46.0" +version = "0.47.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/former/Cargo.toml b/module/core/former/Cargo.toml index 8853bcc29d..0a9036e994 100644 --- a/module/core/former/Cargo.toml +++ b/module/core/former/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "former" -version = "2.28.0" +version = "2.29.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/former_meta/Cargo.toml b/module/core/former_meta/Cargo.toml index cf669e31c5..19fdeec963 100644 --- a/module/core/former_meta/Cargo.toml +++ b/module/core/former_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "former_meta" -version = "2.27.0" +version = "2.28.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/former_types/Cargo.toml b/module/core/former_types/Cargo.toml index e3538dca51..ed8237d9cc 100644 --- a/module/core/former_types/Cargo.toml +++ b/module/core/former_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "former_types" -version = "2.24.0" +version = "2.25.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/interval_adapter/Cargo.toml b/module/core/interval_adapter/Cargo.toml index ea18e29aeb..d2380b6045 100644 --- a/module/core/interval_adapter/Cargo.toml +++ b/module/core/interval_adapter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "interval_adapter" -version = "0.36.0" +version = "0.37.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/iter_tools/Cargo.toml b/module/core/iter_tools/Cargo.toml index 511fae0e24..01df5ff880 100644 --- a/module/core/iter_tools/Cargo.toml +++ b/module/core/iter_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iter_tools" -version = "0.37.0" +version = "0.38.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/macro_tools/Cargo.toml b/module/core/macro_tools/Cargo.toml index d0b8e016e0..daa8ff4af2 100644 --- a/module/core/macro_tools/Cargo.toml +++ b/module/core/macro_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "macro_tools" -version = "0.67.0" +version = "0.68.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/mod_interface/Cargo.toml b/module/core/mod_interface/Cargo.toml index ea955faa19..8ac7976943 100644 --- a/module/core/mod_interface/Cargo.toml +++ b/module/core/mod_interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mod_interface" -version = "0.44.0" +version = "0.45.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/mod_interface_meta/Cargo.toml b/module/core/mod_interface_meta/Cargo.toml index 386e581fae..f7d0ec0c80 100644 --- a/module/core/mod_interface_meta/Cargo.toml +++ b/module/core/mod_interface_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mod_interface_meta" -version = "0.42.0" +version = "0.43.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/process_tools/Cargo.toml b/module/core/process_tools/Cargo.toml index 2e40fbfbfc..6980a08f18 100644 --- a/module/core/process_tools/Cargo.toml +++ b/module/core/process_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "process_tools" -version = "0.15.0" +version = "0.16.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/pth/Cargo.toml b/module/core/pth/Cargo.toml index 60fbc48339..dac52d187a 100644 --- a/module/core/pth/Cargo.toml +++ b/module/core/pth/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pth" -version = "0.25.0" +version = "0.26.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/strs_tools/Cargo.toml b/module/core/strs_tools/Cargo.toml index 8c7d81b444..28cc3e85e2 100644 --- a/module/core/strs_tools/Cargo.toml +++ b/module/core/strs_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strs_tools" -version = "0.29.0" +version = "0.30.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/strs_tools_meta/Cargo.toml b/module/core/strs_tools_meta/Cargo.toml index b8fa2c45e5..c8bce1cc60 100644 --- a/module/core/strs_tools_meta/Cargo.toml +++ b/module/core/strs_tools_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strs_tools_meta" -version = "0.6.0" +version = "0.7.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/test_tools/src/test/smoke_test.rs b/module/core/test_tools/src/test/smoke_test.rs index f1295bd391..9caf0709b2 100644 --- a/module/core/test_tools/src/test/smoke_test.rs +++ b/module/core/test_tools/src/test/smoke_test.rs @@ -452,7 +452,7 @@ mod private { // On Windows, we need to escape backslashes for TOML #[cfg(target_os = "windows")] { - Ok(path_str.replace('\\', "\\\\")) + path_str.replace('\\', "\\\\") } // On Unix-like systems, paths should work as-is in TOML diff --git a/module/core/variadic_from/Cargo.toml b/module/core/variadic_from/Cargo.toml index f1d54a7b9e..e046737a8b 100644 --- a/module/core/variadic_from/Cargo.toml +++ b/module/core/variadic_from/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variadic_from" -version = "0.41.0" +version = "0.42.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/variadic_from_meta/Cargo.toml b/module/core/variadic_from_meta/Cargo.toml index f13e2b233f..3b94027885 100644 --- a/module/core/variadic_from_meta/Cargo.toml +++ b/module/core/variadic_from_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variadic_from_meta" -version = "0.12.0" +version = "0.13.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/move/crates_tools/Cargo.toml b/module/move/crates_tools/Cargo.toml index 3cf6ec48b0..ffb97bb225 100644 --- a/module/move/crates_tools/Cargo.toml +++ b/module/move/crates_tools/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crates_tools" -version = "0.17.0" +version = "0.18.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/move/unilang/Cargo.toml b/module/move/unilang/Cargo.toml index 1d7f40ec3c..088b346c32 100644 --- a/module/move/unilang/Cargo.toml +++ b/module/move/unilang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unilang" -version = "0.12.0" +version = "0.13.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/move/unilang/performance.md b/module/move/unilang/performance.md deleted file mode 100644 index d0583958db..0000000000 --- a/module/move/unilang/performance.md +++ /dev/null @@ -1,211 +0,0 @@ -# Unilang Performance Analysis & Optimization Roadmap - -## Executive Summary - -Performance analysis reveals that **Pico-Args achieves ~167x better throughput** than Unilang (6.4M vs 38K commands/sec). This gap stems from fundamental architectural differences: Pico-Args uses ultra-minimalist zero-copy design while Unilang provides enterprise-grade features with complex processing pipelines. - -**Key Finding**: Unilang's performance bottlenecks are primarily in string-heavy parsing operations that are prime candidates for SIMD optimization. - -## Benchmark Results Analysis - -| Framework | Throughput | P99 Latency | Performance Gap | -|-----------|------------|-------------|----------------| -| **Pico-Args** | 6,401,016 cmd/sec | 160ns | Baseline | -| **Unilang** | 38,536 cmd/sec | 40,840ns | **167x slower** | -| **Clap** | 1,033 cmd/sec | 1,135,809ns | 6,197x slower | - -### Scaling Characteristics -- **Unilang**: Excellent scaling (constant ~38K cmd/sec from 10 to 1K commands) -- **Pico-Args**: Consistent performance (~6.4M cmd/sec across all scales) -- **Clap**: Poor scaling (88K → 1K cmd/sec as commands increase) - -## Performance Bottleneck Analysis - -### 🔴 Critical Bottlenecks (High Impact) - -#### **1. Excessive String Allocations in Parsing** -**Location**: `unilang_parser/src/item_adapter.rs:125-137` -**Impact**: 5-15 string allocations per command -```rust -// BOTTLENECK: Every token creates new String -Ok((UnilangTokenKind::Identifier(s.string.to_string()), original_location)) -``` -**Estimated Impact**: **40-60% of hot path time** - -#### **2. Command Name String Construction** -**Location**: `semantic.rs:96-103` -**Impact**: String formatting for every command lookup -```rust -// BOTTLENECK: String formatting per lookup -let command_name = format!(".{}", instruction.command_path_slices.join(".")); -``` -**Estimated Impact**: **10-15% of hot path time** - -#### **3. Multiple String Cloning in Semantic Analysis** -**Location**: `semantic.rs:150, 160, 185, 203` -**Impact**: Argument names cloned multiple times -```rust -// BOTTLENECK: Argument names cloned repeatedly -bound_arguments.insert(arg_def.name.clone(), parse_value(&parser_arg.value, &arg_def.kind)?); -``` -**Estimated Impact**: **20-30% of hot path time** - -#### **4. Value Parsing String Conversions** -**Location**: `types.rs:150, 159, 169, 307` -**Impact**: Every argument creates string allocations -```rust -// BOTTLENECK: Multiple string conversions during type parsing -Kind::String => Ok(Value::String(input.to_string())), -Kind::Boolean => match input.to_lowercase().as_str() { // Creates new string -``` -**Estimated Impact**: **20-30% of hot path time** - -### 🟡 Moderate Bottlenecks (Medium Impact) - -#### **5. Validation Rule Processing** -- Regex compilation during validation (not cached) -- Multiple validation rules iterate over same data -- **Estimated Impact**: 5-10% of hot path time - -#### **6. HashMap Lookups in Hot Path** -- Multiple HashMap lookups per argument -- O(k) lookups where k = number of aliases per argument -- **Estimated Impact**: 5-10% of hot path time - -### 🟢 Minor Bottlenecks (Low Impact) - -#### **7. Vec Collections Instead of Iterators** -- Intermediate vector allocations instead of streaming -- **Estimated Impact**: 2-5% of hot path time - -## Root Cause Analysis: Why Pico-Args is 167x Faster - -### Architectural Philosophy Differences - -| Aspect | Pico-Args | Unilang | -|--------|-----------|---------| -| **Design Goal** | Ultra-minimalist argument parser | Enterprise multi-modal framework | -| **Dependencies** | Zero dependencies | 50+ dependencies with rich features | -| **Memory Model** | Zero-copy, in-place modification | Multi-stage with intermediate allocations | -| **String Handling** | Borrowed `&str` and `&OsStr` | Owned `String` with extensive cloning | -| **Processing** | Direct Vec manipulation | 7-stage processing pipeline | -| **Validation** | Minimal (trusts caller) | Extensive (type system + validation rules) | - -### Key Performance Advantages of Pico-Args - -1. **Zero-Copy Design**: Uses string slices instead of allocating -2. **Minimal Surface Area**: Does one thing extremely well -3. **Direct Memory Access**: Modifies Vec in-place without intermediate collections -4. **No Validation Overhead**: Pushes complexity to caller -5. **Simple Algorithms**: Linear search faster than complex lookups for small datasets - -## SIMD Optimization Opportunities - -### Current SIMD Status -- **Pico-Args**: Zero SIMD (zero dependencies by design) -- **Unilang**: Partial SIMD through `memchr`, `aho-corasick`, `regex` dependencies - -### High-Impact SIMD Optimizations - -#### **1. String Tokenization Enhancement** -**Target**: `strs_tools::split()` operations in parser -**Solution**: Direct `memchr::memchr_iter()` usage -**Expected Gain**: **3-6x improvement** in tokenization - -#### **2. JSON Parsing Acceleration** -**Target**: `serde_json::from_str()` calls in value parsing -**Solution**: Replace with `simd-json` crate -**Expected Gain**: **4-25x improvement** for JSON-heavy workloads - -#### **3. Multi-Pattern Matching** -**Target**: Enum validation and pattern matching -**Solution**: `aho-corasick` for multi-pattern searches -**Expected Gain**: **2-10x improvement** for large choice sets - -#### **4. Delimiter Processing** -**Target**: String splitting operations in `types.rs` -**Solution**: SIMD-optimized delimiter finding with `bytecount` -**Expected Gain**: **2-4x improvement** in string processing - -### Recommended SIMD Dependencies -```toml -[dependencies] -simd-json = "0.13" # 4-25x faster JSON parsing -bytecount = "0.6" # SIMD byte counting -memchr = "2.7" # Explicit usage (already available via regex) -``` - -## Optimization Roadmap - -### 🚀 Phase 1: High-Impact Quick Wins (Estimated 5-10x improvement) - -1. **String Interning System** - Cache commonly used strings -2. **Zero-Copy Parser Tokens** - Use `&str` instead of `String` in tokens -3. **Command Name Caching** - Intern command names to avoid reconstruction -4. **SIMD Tokenization** - Replace `strs_tools::split()` with `memchr` - -### 🎯 Phase 2: Medium-Impact Optimizations (Estimated 2-3x improvement) - -5. **Argument Pool Allocation** - Reuse argument structures -6. **Validation Rule Caching** - Pre-compile and cache regex patterns -7. **Streaming Iterators** - Replace intermediate Vec collections -8. **HashMap Optimization** - Use `ahash` for faster hashing - -### 📊 Phase 3: Advanced SIMD Integration (Estimated 2-4x improvement) - -9. **SIMD JSON Parsing** - Replace `serde_json` with `simd-json` -10. **Multi-Pattern Matching** - Use `aho-corasick` for enum validation -11. **SIMD String Operations** - Leverage `bytecount` for character operations -12. **Custom SIMD Routines** - Hand-optimized SIMD for hot paths - -## Task Index & Implementation Plan - -### Unilang Core Optimizations -- [**Task 001**](task/001_string_interning_system.md) - Implement string interning for command names -- [**Task 002**](task/002_zero_copy_parser_tokens_ref.md) - Convert parser tokens to use string slices (ref) -- [**Task 003**](task/003_command_name_caching.md) - Cache command name construction -- [**Task 004**](task/004_simd_tokenization.md) - Replace string splitting with SIMD operations - -### Parser Optimizations -- [**Task 005**](task/005_streaming_parser.md) - Convert to streaming iterator design -- [**Task 006**](task/006_validation_rule_caching.md) - Pre-compile validation patterns -- [**Task 007**](task/007_simd_delimiter_processing.md) - SIMD-optimize delimiter finding - -### Type System Optimizations -- [**Task 008**](task/008_argument_pool_allocation.md) - Implement argument structure pooling -- [**Task 009**](task/009_simd_json_parsing.md) - Integrate simd-json for value parsing -- [**Task 010**](task/010_enum_pattern_matching.md) - Multi-pattern matching for enums - -### Dependencies Optimizations (References) -- [**Task 011**](task/011_strs_tools_simd_ref.md) - Add SIMD support to strs_tools crate (ref) -- [**Task 012**](task/012_former_optimization_ref.md) - Optimize former macro expansion (ref) -- [**Task 013**](task/013_error_tools_streamline.md) - Streamline error handling overhead - -### Dependency Task Implementations -- [**strs_tools SIMD**](../../core/strs_tools/task/001_simd_optimization.md) - Full SIMD implementation for string operations -- [**unilang_parser Zero-Copy**](../../move/unilang_parser/task/001_zero_copy_tokens.md) - Full zero-copy token implementation -- [**former Optimization**](../../core/former/task/001_macro_optimization.md) - Full former macro optimization - -## Expected Performance Outcomes - -### Conservative Estimates -- **Phase 1**: 5-10x improvement → ~200K-380K cmd/sec -- **Phase 2**: Additional 2-3x → ~400K-1.1M cmd/sec -- **Phase 3**: Additional 2-4x → ~800K-4.4M cmd/sec -- **Total**: **20-100x improvement** (approaching Pico-Args performance) - -### Optimistic Estimates -- **Combined optimizations**: Could achieve **50-200x** improvement -- **Target performance**: **1.9M-7.7M cmd/sec** (competitive with Pico-Args) -- **Performance position**: Match or exceed Pico-Args while maintaining enterprise features - -## Conclusion - -The 167x performance gap between Unilang and Pico-Args represents a fundamental architectural trade-off between **enterprise features** and **raw performance**. However, through targeted SIMD optimizations and string handling improvements, Unilang can potentially achieve **competitive performance** while maintaining its rich feature set. - -The optimization roadmap provides a clear path to **20-200x performance improvements**, making Unilang both feature-rich AND performance-competitive. - ---- -*Analysis Date: 2025-08-05* -*Benchmark Version: throughput_benchmark v0.5.0* -*Target Architecture: x86_64 with AVX2 SIMD support* \ No newline at end of file diff --git a/module/move/unilang/PERFORMANCE.md b/module/move/unilang/perofrmance.md similarity index 100% rename from module/move/unilang/PERFORMANCE.md rename to module/move/unilang/perofrmance.md diff --git a/module/move/unilang_parser/Cargo.toml b/module/move/unilang_parser/Cargo.toml index 8ba135f437..6d1cbf310e 100644 --- a/module/move/unilang_parser/Cargo.toml +++ b/module/move/unilang_parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unilang_parser" -version = "0.11.0" +version = "0.12.0" edition = "2021" license = "MIT" readme = "readme.md" diff --git a/module/move/wca/Cargo.toml b/module/move/wca/Cargo.toml index 838207577f..a88587a285 100644 --- a/module/move/wca/Cargo.toml +++ b/module/move/wca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wca" -version = "0.28.0" +version = "0.29.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/move/wca/src/ca/verifier/verifier.rs b/module/move/wca/src/ca/verifier/verifier.rs index 05827d2b38..5924acc642 100644 --- a/module/move/wca/src/ca/verifier/verifier.rs +++ b/module/move/wca/src/ca/verifier/verifier.rs @@ -272,7 +272,7 @@ mod private } // fix clippy let command = dictionary.command( &raw_command.name ) - .ok_or_else( || + .ok_or( { #[ cfg( feature = "on_unknown_suggest" ) ] { diff --git a/module/move/willbe/Cargo.toml b/module/move/willbe/Cargo.toml index 4d815a7c5b..0f2d7915a5 100644 --- a/module/move/willbe/Cargo.toml +++ b/module/move/willbe/Cargo.toml @@ -1,7 +1,7 @@ # module/move/willbe/Cargo.toml [package] name = "willbe" -version = "0.24.0" +version = "0.25.0" edition = "2021" authors = [ "Kostiantyn Wandalen ",