Skip to content

Commit 9e248ce

Browse files
committed
perf(lib): streamline the grammar and other performance improvements
streamlined the grammar Added atomic (@) on single-token rules Turned pure look-ahead helpers into silent rules Small-buffer optimisation for map:{…} pipelines inline the tiny hot helpers
1 parent 2b02311 commit 9e248ce

File tree

6 files changed

+192
-86
lines changed

6 files changed

+192
-86
lines changed

Cargo.lock

Lines changed: 80 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ pest = "2.8.0"
2020
pest_derive = "2.8.0"
2121
strip-ansi-escapes = "0.2.1"
2222
once_cell = "1.21.3"
23+
parking_lot = "0.12.3"
24+
dashmap = "6.1.0"
25+
smallvec = "1.15.0"
26+
memchr = "2.7.4"
2327

2428
[build-dependencies]
2529
clap = { version = "4.5.39", features = ["derive", "cargo"] }

src/pipeline/debug.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ impl DebugTracer {
9797
self.line_with_prefix(format!("🎯 Final result: {:?}", result), 1);
9898
self.line_with_prefix(format!("Total execution time: {:?}", elapsed), 1);
9999

100-
let regex_cache = REGEX_CACHE.lock().unwrap();
101-
let split_cache = SPLIT_CACHE.lock().unwrap();
102100
self.line_with_ending_prefix(
103101
format!(
104102
"Cache stats: {} regex patterns, {} split operations cached",
105-
regex_cache.len(),
106-
split_cache.len()
103+
REGEX_CACHE.len(),
104+
SPLIT_CACHE.len()
107105
),
108106
1,
109107
);
@@ -439,16 +437,8 @@ impl DebugTracer {
439437

440438
/// Formats a string operation for display with key parameters.
441439
///
442-
/// Provides informative representations of operations including
443-
/// important parameters like separators and operation counts.
444-
///
445-
/// # Arguments
446-
///
447-
/// * `op` - The operation to format
448-
///
449-
/// # Returns
450-
///
451-
/// A formatted string representation of the operation
440+
/// Provides informative representations of operations including important
441+
/// parameters like separators and operation counts.
452442
fn format_operation(op: &StringOp) -> String {
453443
match op {
454444
StringOp::Split { sep, .. } => format!("Split('{}')", sep),
@@ -458,17 +448,7 @@ impl DebugTracer {
458448
}
459449
}
460450

461-
/// Returns the simple name of a string operation.
462-
///
463-
/// Provides basic operation names without parameters for compact display.
464-
///
465-
/// # Arguments
466-
///
467-
/// * `op` - The operation to name
468-
///
469-
/// # Returns
470-
///
471-
/// The operation name as a string
451+
/// Returns the simple name of a string operation without parameters.
472452
fn format_operation_name(op: &StringOp) -> String {
473453
match op {
474454
StringOp::Split { .. } => "Split".to_string(),

0 commit comments

Comments
 (0)