Skip to content

Commit

Permalink
Add bench and fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
titaneric committed Jan 3, 2025
1 parent 243c465 commit 9dd914c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions benches/stdlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ criterion_group!(
parse_aws_alb_log,
parse_aws_cloudwatch_log_subscription_message,
parse_aws_vpc_flow_log,
parse_bytes,
parse_common_log,
parse_csv,
parse_duration,
Expand Down Expand Up @@ -1644,6 +1645,15 @@ bench_function! {
}
}

bench_function! {
parse_bytes => vrl::stdlib::ParseBytes;

literal {
args: func_args![value: "1024KiB", unit: "MiB"],
want: Ok(1.0),
}
}

bench_function! {
parse_common_log => vrl::stdlib::ParseCommonLog;

Expand Down
2 changes: 1 addition & 1 deletion src/stdlib/parse_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ mod tests {
args: func_args![value: "768MB",
unit: "PB",
base: "10"],
want: Ok(0.000000768),
want: Ok(0.000_000_768),
tdef: TypeDef::float().fallible(),
}

Expand Down

0 comments on commit 9dd914c

Please sign in to comment.