Fix benchmark

This commit is contained in:
Maximilian Ammann 2022-01-09 12:54:47 +01:00
parent c1ed14b909
commit c43a718056
5 changed files with 4 additions and 28 deletions

View File

@ -27,29 +27,7 @@ fn tile1(c: &mut Criterion) {
)
.into(),
)
.unwrap()
.contents(),
))
.expect("failed to load tile");
c.bench_function("tessselate_stroke", |b| b.iter(|| tessselate_stroke(&tile)));
c.bench_function("tessselate_fill", |b| b.iter(|| tessselate_fill(&tile)));
}
fn tile2(c: &mut Criterion) {
let fetcher = StaticTileFetcher::new();
let tile = parse_tile_reader(&mut Cursor::new(
fetcher
.sync_fetch_tile(
&(
mapr::example::MUNICH_X,
mapr::example::MUNICH_Y,
mapr::example::MUNICH_Z,
)
.into(),
)
.unwrap()
.contents(),
.unwrap(),
))
.expect("failed to load tile");

View File

@ -7,9 +7,8 @@ use log::{error, info};
use crate::coords::TileCoords;
use vector_tile::parse_tile_bytes;
use crate::io::static_tile_fetcher::StaticTileFetcher;
use crate::io::web_tile_fetcher::WebTileFetcher;
use crate::io::{web_tile_fetcher, TileFetcher};
use crate::io::TileFetcher;
use crate::render::shader_ffi::GpuVertexUniform;
use crate::tesselation::{IndexDataType, OverAlignedVertexBuffer, Tesselated};

View File

@ -2,7 +2,7 @@ use std::concat;
use std::env;
use async_trait::async_trait;
use include_dir::{include_dir, Dir, File};
use include_dir::{include_dir, Dir};
use crate::coords::TileCoords;
use crate::error::Error;

View File

@ -3,7 +3,6 @@ use crate::error::Error;
use crate::io::{HttpFetcher, TileFetcher};
use crate::platform::PlatformHttpFetcher;
use async_trait::async_trait;
use core::panicking::panic;
pub struct WebTileFetcher {
http_fetcher: PlatformHttpFetcher,

View File

@ -25,7 +25,7 @@ pub struct PlatformHttpFetcher {
client: ClientWithMiddleware,
}
#[async_trait]
#[async_trait(?Send)]
impl HttpFetcher for PlatformHttpFetcher {
fn new() -> Self {
let client = ClientBuilder::new(Client::new())