Skip to content

Commit 28d0632

Browse files
committed
wip
1 parent 1a4e482 commit 28d0632

File tree

7 files changed

+163
-113
lines changed

7 files changed

+163
-113
lines changed

module/core/strs_tools/benchmarks/current_run_results.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Latest Benchmark Execution Results
22

3-
*Generated: 2025-08-06 12:45 UTC*
3+
*Generated: 2025-08-06 12:56 UTC*
44

55
## Benchmark Execution Summary
66

@@ -25,34 +25,34 @@ The benchmark system tests three critical bottlenecks:
2525

2626
### Detailed Timing Data
2727
**Multi-delimiter 2KB** (2KB)
28-
- Scalar: 2.457ms (812.9 MiB/s)
29-
- SIMD: 0.181ms (11.1 MiB/s)
30-
- **Improvement: 13.6x faster**
28+
- Scalar: 2.673ms (747.3 MiB/s)
29+
- SIMD: 0.196ms (12.1 MiB/s)
30+
- **Improvement: 13.0x faster**
3131

3232
**Multi-delimiter 10KB** (10KB)
33-
- Scalar: 12.838ms (778.9 MiB/s)
34-
- SIMD: 0.421ms (23.9 MiB/s)
35-
- **Improvement: 30.5x faster**
33+
- Scalar: 13.965ms (716.0 MiB/s)
34+
- SIMD: 0.458ms (26.0 MiB/s)
35+
- **Improvement: 29.1x faster**
3636

3737
**Multi-delimiter 50KB** (50KB)
38-
- Scalar: 89.468ms (558.8 MiB/s)
39-
- SIMD: 0.652ms (77.2 MiB/s)
40-
- **Improvement: 137.0x faster**
38+
- Scalar: 97.317ms (513.7 MiB/s)
39+
- SIMD: 0.709ms (83.9 MiB/s)
40+
- **Improvement: 131.0x faster**
4141

4242
**Large input 100KB** (100KB)
43-
- Scalar: 146.037ms (684.7 MiB/s)
44-
- SIMD: 8.927ms (11.3 MiB/s)
45-
- **Improvement: 16.4x faster**
43+
- Scalar: 158.850ms (629.5 MiB/s)
44+
- SIMD: 9.710ms (12.3 MiB/s)
45+
- **Improvement: 15.7x faster**
4646

4747
**Large input 500KB** (500KB)
48-
- Scalar: 784.647ms (637.2 MiB/s)
49-
- SIMD: 41.324ms (12.2 MiB/s)
50-
- **Improvement: 19.0x faster**
48+
- Scalar: 853.489ms (585.8 MiB/s)
49+
- SIMD: 44.949ms (13.2 MiB/s)
50+
- **Improvement: 18.1x faster**
5151

5252
**Pattern complexity - 8 delims** (10KB)
53-
- Scalar: 235.203ms (43.6 MiB/s)
54-
- SIMD: 1.103ms (9.3 MiB/s)
55-
- **Improvement: 212.9x faster**
53+
- Scalar: 255.839ms (40.1 MiB/s)
54+
- SIMD: 1.200ms (10.2 MiB/s)
55+
- **Improvement: 203.5x faster**
5656

5757

5858
## Performance Characteristics

module/core/strs_tools/benchmarks/detailed_results.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Based on recent benchmark runs, SIMD optimizations provide the following improve
88

99
| Test Category | Input Size | Improvement | Detailed Metrics |
1010
|---------------|------------|-------------|------------------|
11-
| Multi-delimiter 2KB | 2KB | 13.6x faster | Scalar: 2.46ms, SIMD: 0.18ms (11 MiB/s) |
12-
| Multi-delimiter 10KB | 10KB | 30.5x faster | Scalar: 12.84ms, SIMD: 0.42ms (24 MiB/s) |
13-
| Multi-delimiter 50KB | 50KB | 137.0x faster | Scalar: 89.47ms, SIMD: 0.65ms (77 MiB/s) |
14-
| Large input 100KB | 100KB | 16.4x faster | Scalar: 146.04ms, SIMD: 8.93ms (11 MiB/s) |
15-
| Large input 500KB | 500KB | 19.0x faster | Scalar: 784.65ms, SIMD: 41.32ms (12 MiB/s) |
16-
| Pattern complexity - 8 delims | 10KB | 212.9x faster | Scalar: 235.20ms, SIMD: 1.10ms (9 MiB/s) |
11+
| Multi-delimiter 2KB | 2KB | 13.0x faster | Scalar: 2.67ms, SIMD: 0.20ms (12 MiB/s) |
12+
| Multi-delimiter 10KB | 10KB | 29.1x faster | Scalar: 13.96ms, SIMD: 0.46ms (26 MiB/s) |
13+
| Multi-delimiter 50KB | 50KB | 131.0x faster | Scalar: 97.32ms, SIMD: 0.71ms (84 MiB/s) |
14+
| Large input 100KB | 100KB | 15.7x faster | Scalar: 158.85ms, SIMD: 9.71ms (12 MiB/s) |
15+
| Large input 500KB | 500KB | 18.1x faster | Scalar: 853.49ms, SIMD: 44.95ms (13 MiB/s) |
16+
| Pattern complexity - 8 delims | 10KB | 203.5x faster | Scalar: 255.84ms, SIMD: 1.20ms (10 MiB/s) |
1717

1818
## Bottleneck Analysis
1919

@@ -29,5 +29,5 @@ Based on recent benchmark runs, SIMD optimizations provide the following improve
2929

3030
---
3131

32-
*Generated: 2025-08-06 12:45 UTC*
32+
*Generated: 2025-08-06 12:56 UTC*
3333
*This file updated after each benchmark run*

module/core/strs_tools/benchmarks/readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Executive Summary
44

5-
SIMD optimization provides **dramatic performance improvements** for string processing operations, with improvements ranging from **13.6x to 212.9x faster** depending on operation complexity.
5+
SIMD optimization provides **dramatic performance improvements** for string processing operations, with improvements ranging from **13.0x to 203.5x faster** depending on operation complexity.
66

77
## Key Results
88

9-
- **Multi-delimiter splitting**: 71.5x average improvement
10-
- **Large input processing**: 19.0x improvement on 500KB inputs
11-
- **Complex patterns**: 212.9x improvement with 8 delimiters
12-
- **Peak SIMD throughput**: 77.2 MiB/s vs 812.9 MiB/s scalar
9+
- **Multi-delimiter splitting**: 68.4x average improvement
10+
- **Large input processing**: 18.1x improvement on 500KB inputs
11+
- **Complex patterns**: 203.5x improvement with 8 delimiters
12+
- **Peak SIMD throughput**: 83.9 MiB/s vs 747.3 MiB/s scalar
1313

1414
## How to Run
1515

@@ -33,5 +33,5 @@ Benchmarks automatically update the following files:
3333

3434
---
3535

36-
*Last updated: 2025-08-06 12:45 UTC*
36+
*Last updated: 2025-08-06 12:56 UTC*
3737
*All documentation automatically generated during benchmark execution*

module/move/unilang/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ all-features = false
2828
default = [ "enabled", "simd" ]
2929
full = [ "enabled", "on_unknown_suggest", "simd" ]
3030
enabled = []
31-
benchmarks = [ "simd" ]
31+
benchmarks = [ "simd", "clap", "pico-args", "criterion" ]
3232

3333
# Performance optimizations - SIMD enabled by default for maximum performance
3434
# Can be disabled with: cargo build --no-default-features --features enabled
@@ -67,6 +67,9 @@ indexmap = "2.2.6"
6767
simd-json = { version = "0.13", optional = true } # SIMD-optimized JSON parsing
6868

6969
# Benchmark dependencies moved to dev-dependencies to avoid production inclusion
70+
clap = { version = "4.4", optional = true }
71+
pico-args = { version = "0.5", optional = true }
72+
criterion = { version = "0.5", optional = true }
7073

7174
[[bin]]
7275
name = "unilang_cli"
@@ -96,14 +99,16 @@ path = "tests/inc/phase3/data_model_features_test.rs"
9699
# name = "performance_stress_test"
97100
# path = "tests/inc/phase4/performance_stress_test.rs"
98101

99-
# Benchmark definitions using native Rust benchmarks
102+
# Criterion-based benchmarks for cargo bench
100103
[[bench]]
101104
name = "comprehensive_benchmark"
102105
path = "benchmarks/comprehensive_framework_comparison.rs"
106+
harness = false
103107

104108
[[bench]]
105109
name = "throughput_benchmark"
106110
path = "benchmarks/throughput_benchmark.rs"
111+
harness = false
107112

108113
[[test]]
109114
name = "run_all_benchmarks"

module/move/unilang/benchmarks/comprehensive_framework_comparison.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//! exponentially increasing command counts, providing detailed metrics for
55
//! framework selection decisions.
66
7-
#![feature(test)]
8-
extern crate test;
97

108
#[ cfg( feature = "benchmarks" ) ]
119
use std::time::{Duration, Instant};
@@ -1486,17 +1484,24 @@ fn run_comprehensive_benchmark() {
14861484
}
14871485

14881486
#[cfg(feature = "benchmarks")]
1489-
#[bench]
1490-
fn comprehensive_benchmark(b: &mut test::Bencher) {
1491-
// Run the comprehensive benchmark once per iteration
1492-
b.iter(|| {
1493-
run_comprehensive_benchmark()
1487+
use criterion::{criterion_group, criterion_main, Criterion};
1488+
1489+
#[cfg(feature = "benchmarks")]
1490+
fn comprehensive_benchmark(c: &mut Criterion) {
1491+
c.bench_function("comprehensive_benchmark", |b| {
1492+
b.iter(|| run_comprehensive_benchmark())
14941493
});
14951494
}
14961495

1496+
#[cfg(feature = "benchmarks")]
1497+
criterion_group!(benches, comprehensive_benchmark);
1498+
#[cfg(feature = "benchmarks")]
1499+
criterion_main!(benches);
1500+
14971501
#[cfg(not(feature = "benchmarks"))]
1498-
#[bench]
1499-
fn comprehensive_benchmark(_b: &mut test::Bencher) {
1500-
panic!("Benchmarks not enabled! Run with: cargo bench --features benchmarks");
1502+
fn main() {
1503+
eprintln!("Error: Benchmarks not enabled!");
1504+
eprintln!("Run with: cargo bench --features benchmarks");
1505+
std::process::exit(1);
15011506
}
15021507

module/move/unilang/benchmarks/throughput_benchmark.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
//! different command counts, without compile-time measurements. Designed for
55
//! quick performance validation and regression testing.
66
7-
#![feature(test)]
8-
extern crate test;
9-
107
//! ## Key Benchmarking Insights from Unilang Development:
118
//!
129
//! 1. **Two-Tier Strategy**: Fast throughput (30-60s) for daily validation,
@@ -916,18 +913,25 @@ fn run_throughput_benchmark() {
916913
}
917914

918915
#[cfg(feature = "benchmarks")]
919-
#[bench]
920-
fn throughput_benchmark(b: &mut test::Bencher) {
921-
// Run the throughput benchmark once per iteration
922-
b.iter(|| {
923-
run_throughput_benchmark()
916+
use criterion::{criterion_group, criterion_main, Criterion};
917+
918+
#[cfg(feature = "benchmarks")]
919+
fn throughput_benchmark(c: &mut Criterion) {
920+
c.bench_function("throughput_benchmark", |b| {
921+
b.iter(|| run_throughput_benchmark())
924922
});
925923
}
926924

925+
#[cfg(feature = "benchmarks")]
926+
criterion_group!(benches, throughput_benchmark);
927+
#[cfg(feature = "benchmarks")]
928+
criterion_main!(benches);
929+
927930
#[cfg(not(feature = "benchmarks"))]
928-
#[bench]
929-
fn throughput_benchmark(_b: &mut test::Bencher) {
930-
panic!("Benchmarks not enabled! Run with: cargo bench --features benchmarks");
931+
fn main() {
932+
eprintln!("Error: Benchmarks not enabled!");
933+
eprintln!("Run with: cargo bench --features benchmarks");
934+
std::process::exit(1);
931935
}
932936

933937
#[cfg(test)]

0 commit comments

Comments
 (0)