diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-09 19:46:57 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-09 19:46:57 +0100 |
| commit | 06ca740d01b428f12f6bd327257cd05dce737b03 (patch) | |
| tree | 995bf8ff3a606aedecf296c9e805e11e9cd0ae8e /bench | |
| parent | e35bbfffcb1f84b2fb0679759152ca0a5eabfad4 (diff) | |
Split evaluation and execution 🔪
Diffstat (limited to 'bench')
| -rw-r--r-- | bench/src/bench.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bench/src/bench.rs b/bench/src/bench.rs index 2d3230db..88e2388d 100644 --- a/bench/src/bench.rs +++ b/bench/src/bench.rs @@ -2,7 +2,8 @@ use criterion::{criterion_group, criterion_main, Criterion}; use fontdock::fs::FsIndex; use typst::env::{Env, ResourceLoader}; -use typst::eval::{eval, State}; +use typst::eval::eval; +use typst::exec::{exec, State}; use typst::export::pdf; use typst::font::FsIndexExt; use typst::layout::layout; @@ -33,14 +34,16 @@ fn benchmarks(c: &mut Criterion) { // Prepare intermediate results and run warm. let syntax_tree = parse(COMA).output; - let layout_tree = eval(&syntax_tree, &mut env, &scope, state.clone()).output; - let frames = layout(&layout_tree, &mut env); + let expr_map = eval(&mut env, &syntax_tree, &scope).output; + let layout_tree = exec(&mut env, &syntax_tree, &expr_map, state.clone()).output; + let frames = layout(&mut env, &layout_tree); // Bench! bench!("parse-coma": parse(COMA)); - bench!("eval-coma": eval(&syntax_tree, &mut env, &scope, state.clone())); - bench!("layout-coma": layout(&layout_tree, &mut env)); - bench!("typeset-coma": typeset(COMA, &mut env, &scope, state.clone())); + bench!("eval-coma": eval(&mut env, &syntax_tree, &scope)); + bench!("exec-coma": exec(&mut env, &syntax_tree, &expr_map, state.clone())); + bench!("layout-coma": layout(&mut env, &layout_tree)); + bench!("typeset-coma": typeset(&mut env, COMA, &scope, state.clone())); bench!("export-pdf-coma": pdf::export(&frames, &env)); } |
