Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,151 changes: 880 additions & 271 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ version = "0.1.0"
authors = ["sunli <[email protected]>"]
edition = "2018"

[dependencies]
async-graphql = "1.4.4"
async-std = { version = "1.5.0", features = ["attributes"] }
juniper = { git = "https://github.com/graphql-rust/juniper"}
futures = "0.3.4"
[dev-dependencies]
criterion = "0.3"
simple = { path = "simple" }

[[bench]]
name = "simple"
harness = false
12 changes: 12 additions & 0 deletions benches/simple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use criterion::{criterion_group, criterion_main, Criterion, black_box};
use simple::{Q, run, parse, serialize, GQLResponse};

pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("run", |b| b.iter(|| run(black_box(Q))));
c.bench_function("parse", |b| b.iter(|| parse(black_box(Q))));
let res = GQLResponse(run(Q));
c.bench_function("serialize", |b| b.iter(|| serialize(black_box(&res))));
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
Loading