From 88ee6c7b8d5196197f56ea1b1e36f517d4245e21 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 3 May 2022 21:54:42 -0400 Subject: [PATCH] fixes --- Cargo.toml | 7 +++++++ parsing/src/suggestions.rs | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 923029e..e8ca4b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,13 @@ opt-level = 0 lto = "thin" strip = false +[profile.bench] +debug = true +codegen-units = 1 +opt-level = 3 +lto = "thin" +strip = false + [dependencies] parsing = { path = "./parsing" } benchmarks = { path = "./benchmarks" } diff --git a/parsing/src/suggestions.rs b/parsing/src/suggestions.rs index e4e87b1..4aa3adf 100644 --- a/parsing/src/suggestions.rs +++ b/parsing/src/suggestions.rs @@ -27,6 +27,8 @@ pub fn split_function(input: &str) -> Vec { } // __REVIEW__ +// __OPTIMIZE__ +// takes up to 33% of performance in calls like `buffer.iter().cloned().collect::()` along with allocating `data` and `buffer` vectors pub fn split_function_chars(chars: &[char]) -> Vec { if chars.is_empty() { return Vec::new(); @@ -94,7 +96,7 @@ pub fn split_function_chars(chars: &[char]) -> Vec { } // If letter and not a variable (or a masked variable) - if prev_char.letter && prev_char.is_variable() { + if prev_char.letter && !prev_char.is_variable() { // Mask number status if current char is number if curr_c.number { curr_c.masked_num = true;