Skip to content

Commit

Permalink
draft make a benchmar with big text
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed Jun 17, 2024
1 parent 2381ccf commit dfe82e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions benches/hugetext.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions benches/my_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
"👨‍👩‍👧‍👧👨‍👩‍👧‍👧👨‍👩‍👧‍👧👨‍👩‍👧‍👧",
"👸🏾",
];
let hugetext = include_str!("hugetext.txt");

c.bench_function("only_text_lorem_ipsum.txt", |b| {
b.iter(|| parse_only_text(black_box(lorem_ipsum_txt)))
Expand Down Expand Up @@ -68,6 +69,9 @@ pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("emoji", |b| {
b.iter(|| emojies.iter().map(|s| get_first_emoji(black_box(s))))
});
c.bench_function("huge text, test performance", |b| {
b.iter(|| parse_desktop_set(black_box(hugetext)))
});
}

criterion_group!(benches, criterion_benchmark);
Expand Down

0 comments on commit dfe82e5

Please sign in to comment.