summaryrefslogtreecommitdiff
path: root/bench/src/parsing.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-09 11:06:37 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-09 11:26:41 +0200
commit3932bb2cb93be95d67fc56998423eb9ce047fdfa (patch)
treec36bd4df1d2c74f8ae100d2f3bd3a0b232b797f5 /bench/src/parsing.rs
parent3c92bad9a7cd6b880de197806443ffcce2cac9d8 (diff)
New source loading architecture
Diffstat (limited to 'bench/src/parsing.rs')
-rw-r--r--bench/src/parsing.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/bench/src/parsing.rs b/bench/src/parsing.rs
index dd5e1279..f95dfe75 100644
--- a/bench/src/parsing.rs
+++ b/bench/src/parsing.rs
@@ -1,7 +1,6 @@
use iai::{black_box, main};
use typst::diag::TypResult;
-use typst::loading::FileId;
use typst::parse::{parse, Scanner, TokenMode, Tokens};
use typst::source::SourceFile;
use typst::syntax::SyntaxTree;
@@ -33,8 +32,7 @@ fn bench_tokenize() -> usize {
}
fn bench_parse() -> TypResult<SyntaxTree> {
- let source = SourceFile::new(FileId::from_raw(0), black_box(SRC).into());
- parse(&source)
+ parse(&SourceFile::detached(black_box(SRC)))
}
main!(bench_decode, bench_scan, bench_tokenize, bench_parse);