summaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-03 13:23:59 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-03 13:23:59 +0200
commit0fc25d732d7cbc37cf801645849d1060f2cec4a3 (patch)
tree706aa8d1bf4135d1dd3ac17a5023bc5e24ded69d /benches
parent8dbc5b60cc4a88f68ee82607af3a3c454cd8f68b (diff)
Port to kurbo 🎋
Diffstat (limited to 'benches')
-rw-r--r--benches/benchmarks.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/benches/benchmarks.rs b/benches/benchmarks.rs
index 52200e66..a6364055 100644
--- a/benches/benchmarks.rs
+++ b/benches/benchmarks.rs
@@ -9,15 +9,10 @@ use typstc::parse::parse;
use typstc::Typesetter;
const FONT_DIR: &str = "fonts";
-
-// 28 not too dense lines.
const COMA: &str = include_str!("../tests/coma.typ");
fn parsing_benchmark(c: &mut Criterion) {
- c.bench_function("parse-coma-28-lines", |b| b.iter(|| parse(COMA)));
-
- let long = COMA.repeat(100);
- c.bench_function("parse-coma-2800-lines", |b| b.iter(|| parse(&long)));
+ c.bench_function("parse-coma", |b| b.iter(|| parse(COMA)));
}
fn typesetting_benchmark(c: &mut Criterion) {
@@ -29,15 +24,9 @@ fn typesetting_benchmark(c: &mut Criterion) {
let loader = FontLoader::new(Box::new(provider), descriptors);
let loader = Rc::new(RefCell::new(loader));
let typesetter = Typesetter::new(loader.clone());
-
- c.bench_function("typeset-coma-28-lines", |b| {
+ c.bench_function("typeset-coma", |b| {
b.iter(|| futures_executor::block_on(typesetter.typeset(COMA)))
});
-
- let long = COMA.repeat(100);
- c.bench_function("typeset-coma-2800-lines", |b| {
- b.iter(|| futures_executor::block_on(typesetter.typeset(&long)))
- });
}
criterion_group!(benches, parsing_benchmark, typesetting_benchmark);