-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
3,874 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
cargo build --profile profiling --example bench | ||
samply record -r 10000 target/profiling/examples/bench |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::time::Instant; | ||
use rtf_parser::header::StyleSheet; | ||
use rtf_parser::lexer::Lexer; | ||
use rtf_parser::parser::Parser; | ||
|
||
fn main() { | ||
let start = Instant::now(); | ||
let doc; | ||
{ | ||
let rtf_text = include_str!("../resources/tests/file-sample_500kB.rtf"); | ||
let tokens = Lexer::scan(rtf_text).expect("Invalid RTF content"); | ||
doc = Parser::new(tokens).parse().unwrap(); | ||
} | ||
let elapsed = start.elapsed(); | ||
assert_eq!(doc.header.stylesheet, StyleSheet::new()); // in order to not get optimized out | ||
println!("Elapsed: {:.2?}", elapsed); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
extern crate rtf_parser; | ||
use rtf_parser::lexer::Lexer; | ||
use rtf_parser::parser::Parser; | ||
use rtf_parser::header::StyleSheet; | ||
|
||
fn main() { | ||
let rtf_text = include_str!("../resources/tests/test-file.rtf"); | ||
let rtf_text = include_str!("../resources/tests/file-sample_500kB.rtf"); | ||
let tokens = Lexer::scan(rtf_text).expect("Invalid RTF content"); | ||
let doc = Parser::new(tokens).parse(); | ||
assert_eq!(doc.unwrap().header.stylesheet, StyleSheet::new()); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters