Skip to content

Commit 263627c

Browse files
committed
Add benchmark for OptFormatter
1 parent 21534f4 commit 263627c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spdlog/benches/spdlog-rs/pattern.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use paste::paste;
88
#[cfg(feature = "serde_json")]
99
use spdlog::formatter::JsonFormatter;
1010
use spdlog::{
11-
formatter::{pattern, Formatter, FormatterContext, FullFormatter, Pattern, PatternFormatter},
11+
formatter::{
12+
pattern, Formatter, FormatterContext, FullFormatter, OptFormatter, Pattern,
13+
PatternFormatter,
14+
},
1215
prelude::*,
1316
sink::{Sink, SinkPropAccess},
1417
Record, StringBuf,
@@ -117,6 +120,11 @@ fn bench_1_json_formatter(bencher: &mut Bencher) {
117120
bench_formatter(bencher, JsonFormatter::new())
118121
}
119122

123+
#[bench]
124+
fn bench_1_opt_formatter(bencher: &mut Bencher) {
125+
bench_formatter(bencher, OptFormatter::builder().build())
126+
}
127+
120128
#[bench]
121129
fn bench_2_full_pattern_ct(bencher: &mut Bencher) {
122130
bench_full_pattern(

0 commit comments

Comments
 (0)