Merge branch 'master' of https://github.com/async-graphql/async-graphql
This commit is contained in:
commit
97f268a55e
11
README.md
11
README.md
|
@ -74,7 +74,18 @@ Ensure that there is no CPU-heavy process in background!
|
|||
|
||||
```shell script
|
||||
cd benchmark
|
||||
|
||||
#measure all with system malloc
|
||||
cargo bench
|
||||
|
||||
#measure only chat run
|
||||
cargo bench -- "chat run"
|
||||
|
||||
#measure all with jemalloc
|
||||
cargo bench --features jemalloc
|
||||
|
||||
#measure only simple run with jemalloc
|
||||
cargo bench --features jemalloc -- "simple run"
|
||||
```
|
||||
|
||||
Now HTML report is available at `benchmark/target/criterion/report`
|
||||
|
|
|
@ -10,12 +10,16 @@ futures = "0.3.4"
|
|||
serde_json = "*"
|
||||
async-graphql-parser = { path = "../async-graphql-parser" }
|
||||
async-graphql = { path = ".." }
|
||||
jemallocator = { version = "0.3.2", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3"
|
||||
simple = { path = "simple" }
|
||||
chat = { path = "chat" }
|
||||
|
||||
[features]
|
||||
jemalloc = ["jemallocator"]
|
||||
|
||||
[[bench]]
|
||||
name = "simple"
|
||||
harness = false
|
||||
|
|
|
@ -3,6 +3,10 @@ use async_graphql::{ObjectType, QueryResponse, Schema, SubscriptionType};
|
|||
use async_graphql_parser::{parse_query, query::Document};
|
||||
use async_std::task;
|
||||
|
||||
#[cfg(feature = "jemalloc")]
|
||||
#[global_allocator]
|
||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
|
||||
pub fn run<Query, Mutation, Subscription>(
|
||||
s: &Schema<Query, Mutation, Subscription>,
|
||||
q: &str,
|
||||
|
|
Loading…
Reference in New Issue
Block a user