Skip to content

Commit

Permalink
Fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rianb committed Apr 28, 2024
1 parent 5c80b43 commit 079b76d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ However, the `rtf-grimoire` crate provide a similar *Lexer*. Here is a quick ben
| Crate | Version | Duration |
|-----------------------------------------------------------------------|:-------:|---------:|
| [`rtf-parser`](https://crates.io/crates/rtf-parser) | v0.3.0 | _7 ms_ |
| [`rtf-grimoire`](https://crates.io/crates/rtf-grimoire) (only lexing) | v0.2.1 | _123 ms_ |
| [`rtf-grimoire`](https://crates.io/crates/rtf-grimoire) (only lexing) | v0.2.1 | _13 ms_ |

*This benchmark has been run on an Intel MacBook Pro, with the release build*.

Expand Down
3 changes: 2 additions & 1 deletion examples/bench.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::time::Instant;

use rtf_parser::header::StyleSheet;
use rtf_parser::lexer::Lexer;
use rtf_parser::parser::Parser;
Expand All @@ -14,4 +15,4 @@ fn main() {
let elapsed = start.elapsed();
assert_eq!(doc.header.stylesheet, StyleSheet::new()); // in order to not get optimized out
println!("Elapsed: {:.2?}", elapsed);
}
}
2 changes: 1 addition & 1 deletion examples/load_file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate rtf_parser;
use rtf_parser::header::StyleSheet;
use rtf_parser::lexer::Lexer;
use rtf_parser::parser::Parser;
use rtf_parser::header::StyleSheet;

fn main() {
let rtf_text = include_str!("../resources/tests/file-sample_500kB.rtf");
Expand Down

0 comments on commit 079b76d

Please sign in to comment.