Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade actix-web to 1.0 #33

Merged
merged 7 commits into from
Oct 26, 2019
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: 'martin*'
files: "martin*"
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1,050 changes: 652 additions & 398 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
name = "martin"
version = "0.4.1"
authors = ["Stepan Kuzmin <to.stepan.kuzmin@gmail.com>"]
edition = "2018"

[lib]
name = "martin"
path = "src/lib.rs"

[[bin]]
name = "martin"
path = "src/bin/main.rs"

[dependencies]
actix = "0.7"
actix-web = "0.7"
actix = "0.8"
actix-rt = "0.2"
actix-web = "1.0"
docopt = "1"
env_logger = "0.7"
futures = "0.1"
Expand All @@ -19,4 +29,11 @@ serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
serde_yaml = "0.8"
tilejson = "0.2"
tilejson = "0.2"

[dev-dependencies]
criterion = "0.3"

[[bench]]
name = "server"
harness = false
37 changes: 37 additions & 0 deletions benches/server.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use criterion::{criterion_group, criterion_main, Criterion};

use actix_web::dev::Service;
use actix_web::{test, App};

use martin::dev::{mock_function_sources, mock_state, mock_table_sources};
use martin::server::router;

fn criterion_benchmark(c: &mut Criterion) {
let state = test::run_on(|| mock_state(mock_table_sources(), mock_function_sources()));
let mut app = test::init_service(App::new().data(state).configure(router));

c.bench_function("/public.table_source/0/0/0.pbf", |b| {
b.iter(|| {
let req = test::TestRequest::get()
.uri("/public.table_source/0/0/0.pbf")
.to_request();

let future = test::run_on(|| app.call(req));
let _response = test::block_on(future).unwrap();
})
});

c.bench_function("/rpc/public.function_source/0/0/0.pbf", |b| {
b.iter(|| {
let req = test::TestRequest::get()
.uri("/rpc/public.function_source/0/0/0.pbf")
.to_request();

let future = test::run_on(|| app.call(req));
let _response = test::block_on(future).unwrap();
})
});
}

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