mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Fix benchmark
This commit is contained in:
parent
c1ed14b909
commit
c43a718056
@ -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");
|
||||
|
||||
|
||||
@ -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};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user